Filter hook 'cron_request'

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

View Source

cron_request

Filter Hook
Description
Filters the cron request arguments. An array of cron request arguments. } }

Hook Information

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

Hook Parameters

Type Name Description
array $cron_request_array { An array of cron request URL arguments.
string $doing_wp_cron The Unix timestamp (UTC) of the cron lock.

Usage Examples

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

function my_custom_filter($cron_request_array, $doing_wp_cron) {
    // Your custom filtering logic here
    return $cron_request_array;
}

Source Code Context

wp-includes/cron.php:954 - How this hook is used in WordPress core
<?php
 949  	 *         @type bool $sslverify Whether SSL should be verified for the request. Default false.
 950  	 *     }
 951  	 * }
 952  	 * @param string $doing_wp_cron The Unix timestamp (UTC) of the cron lock.
 953  	 */
 954  	$cron_request = apply_filters(
 955  		'cron_request',
 956  		array(
 957  			'url'  => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
 958  			'key'  => $doing_wp_cron,
 959  			'args' => array(

PHP Documentation

<?php
/**
	 * Filters the cron request arguments.
	 *
	 * @since 3.5.0
	 * @since 4.5.0 The `$doing_wp_cron` parameter was added.
	 *
	 * @param array $cron_request_array {
	 *     An array of cron request URL arguments.
	 *
	 *     @type string $url  The cron request URL.
	 *     @type int    $key  The 22 digit GMT microtime.
	 *     @type array  $args {
	 *         An array of cron request arguments.
	 *
	 *         @type int  $timeout   The request timeout in seconds. Default .01 seconds.
	 *         @type bool $blocking  Whether to set blocking for the request. Default false.
	 *         @type bool $sslverify Whether SSL should be verified for the request. Default false.
	 *     }
	 * }
	 * @param string $doing_wp_cron The Unix timestamp (UTC) of the cron lock.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/cron.php
Related Hooks

Related hooks will be displayed here in future updates.