cron_request filter-hookWP 3.5.0

Filters the cron request arguments.

Usage

add_filter( 'cron_request', 'wp_kama_cron_request_filter', 10, 2 );

/**
 * Function for `cron_request` filter-hook.
 * 
 * @param array  $cron_request_array An array of cron request URL arguments.
 * @param string $doing_wp_cron      The unix timestamp of the cron lock.
 *
 * @return array
 */
function wp_kama_cron_request_filter( $cron_request_array, $doing_wp_cron ){

	// filter...
	return $cron_request_array;
}
$cron_request_array(array)

An array of cron request URL arguments.

  • url(string)
    The cron request URL.

  • key(int)
    The 22 digit GMT microtime.

  • args(array)
    An array of cron request arguments.

    • timeout(int)
      The request timeout in seconds. Default .01 seconds.

    • blocking(true|false)
      Whether to set blocking for the request.
      Default: false

    • sslverify(true|false)
      Whether SSL should be verified for the request.
      Default: false
$doing_wp_cron(string)
The unix timestamp of the cron lock.

Changelog

Since 3.5.0 Introduced.
Since 4.5.0 The $doing_wp_cron parameter was added.

Where the hook is called

spawn_cron()
cron_request
wp-includes/cron.php 933-946
$cron_request = apply_filters(
	'cron_request',
	array(
		'url'  => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
		'key'  => $doing_wp_cron,
		'args' => array(
			'timeout'   => 0.01,
			'blocking'  => false,
			/** This filter is documented in wp-includes/class-wp-http-streams.php */
			'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
		),
	),
	$doing_wp_cron
);

Where the hook is used in WordPress

Usage not found.