VOOZH about

URL: https://developer.wordpress.org/reference/functions/_get_cron_array/

⇱ _get_cron_array() – Function | Developer.WordPress.org


Skip to content

WordPress Developer Resources

_get_cron_array()

HomeReferenceFunctions_get_cron_array()

_get_cron_array(): array[]

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Retrieves cron info array option.

Return

array[] Array of cron events.

Source

function _get_cron_array() {
	$cron = get_option( 'cron' );
	if ( ! is_array( $cron ) ) {
		return array();
	}

	if ( ! isset( $cron['version'] ) ) {
		$cron = _upgrade_cron_array( $cron );
	}

	unset( $cron['version'] );

	return $cron;
}

View all references View on Trac View on GitHub

Related

UsesDescription
_upgrade_cron_array()wp-includes/cron.php

Upgrades a cron info array.

get_option()wp-includes/option.php

Retrieves an option value based on an option name.

Used byDescription
WP_Site_Health::get_cron_tasks()wp-admin/includes/class-wp-site-health.php

Populates the list of cron events and store them to a class-wide variable.

wp_get_ready_cron_jobs()wp-includes/cron.php

Retrieves cron jobs ready to be run.

wp_get_scheduled_event()wp-includes/cron.php

Retrieves a scheduled event.

wp_unschedule_hook()wp-includes/cron.php

Unschedules all events attached to the hook.

WP_Media_List_Table::prepare_items()wp-admin/includes/class-wp-media-list-table.php

Prepares the list of items for displaying.

wp_schedule_event()wp-includes/cron.php

Schedules a recurring event.

wp_unschedule_event()wp-includes/cron.php

Unschedules a previously scheduled event.

wp_clear_scheduled_hook()wp-includes/cron.php

Unschedules all events attached to the hook with the specified arguments.

wp_schedule_single_event()wp-includes/cron.php

Schedules an event to run only once.

Show 4 moreShow less

Changelog

VersionDescription
6.1.0Return type modified to consistently return an array.
2.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.