wp_get_ready_cron_jobs(): array[]

In this article

Retrieves cron jobs ready to be run.

Description

Returns the results of _get_cron_array() limited to events ready to be run, ie, with a timestamp in the past.

Return

array[] Array of cron job arrays ready to be run.

Source

function wp_get_ready_cron_jobs() {	/** * Filter to override retrieving ready cron jobs. * * Returning an array will short-circuit the normal retrieval of ready * cron jobs, causing the function to return the filtered value instead. * * @since 5.1.0 * * @param null|array[] $pre Array of ready cron tasks to return instead. Default null * to continue using results from _get_cron_array(). */	$pre = apply_filters( 'pre_get_ready_cron_jobs', null );	if ( null !== $pre ) {	return $pre;	}	$crons = _get_cron_array();	$gmt_time = microtime( true );	$results = array();	foreach ( $crons as $timestamp => $cronhooks ) {	if ( $timestamp > $gmt_time ) {	break;	}	$results[ $timestamp ] = $cronhooks;	}	return $results; } 

Hooks

apply_filters( ‘pre_get_ready_cron_jobs’, null|array[] $pre )

Filter to override retrieving ready cron jobs.

Changelog

VersionDescription
5.1.0Introduced.

User Contributed Notes

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