wp_get_ready_cron_jobs
函数
wp_get_ready_cron_jobs ( No parameters )
- 返回值
-
- (array[]) Array of cron job arrays ready to be run.
- 定义位置
-
-
wp-includes/cron.php
, line 1108
-
wp-includes/cron.php
- 引入
- 5.1.0
- 弃用
- –
Retrieve cron jobs ready to be run.
Returns the results of _get_cron_array() limited to events ready to be run,
ie, with a timestamp in the past.
function wp_get_ready_cron_jobs() { /** * Filter to preflight or hijack 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; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。