Filter hook 'pre_get_ready_cron_jobs'

in WP Core File wp-includes/cron.php at line 1194

View Source

pre_get_ready_cron_jobs

Filter Hook
Description
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.

Hook Information

File Location wp-includes/cron.php View on GitHub
Hook Type Filter
Line Number 1194

Hook Parameters

Type Name Description
null|array[] $pre Array of ready cron tasks to return instead. Default null to continue using results from _get_cron_array().

Usage Examples

Basic Usage
<?php
// Hook into pre_get_ready_cron_jobs
add_filter('pre_get_ready_cron_jobs', 'my_custom_filter', 10, 1);

function my_custom_filter($pre) {
    // Your custom filtering logic here
    return $pre;
}

Source Code Context

wp-includes/cron.php:1194 - How this hook is used in WordPress core
<?php
1189  	 * @since 5.1.0
1190  	 *
1191  	 * @param null|array[] $pre Array of ready cron tasks to return instead. Default null
1192  	 *                          to continue using results from _get_cron_array().
1193  	 */
1194  	$pre = apply_filters( 'pre_get_ready_cron_jobs', null );
1195  
1196  	if ( null !== $pre ) {
1197  		return $pre;
1198  	}
1199  

PHP Documentation

<?php
/**
	 * 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().
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/cron.php
Related Hooks

Related hooks will be displayed here in future updates.