在里面wp-includes/default-filters.php
我们可以找到回调注册:
// WP Cron
if ( !defined( \'DOING_CRON\' ) )
add_action( \'init\', \'wp_cron\' );
如果我们去函数
wp_cron()
现在,我们看到:
$schedules = wp_get_schedules();
foreach ( $crons as $timestamp => $cronhooks ) {
if ( $timestamp > $gmt_time ) break;
foreach ( (array) $cronhooks as $hook => $args ) {
if ( isset($schedules[$hook][\'callback\']) && !call_user_func( $schedules[$hook][\'callback\'] ) )
continue;
spawn_cron( $gmt_time );
break 2;
}
}
spawn_cron()
发送您在日志中看到的POST请求:
$doing_wp_cron = sprintf( \'%.22F\', $gmt_time );
set_transient( \'doing_cron\', $doing_wp_cron );
/**
* Filter the cron request arguments.
*
* @since 3.5.0
*
* @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.
* }
* }
*/
$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-http.php */
\'sslverify\' => apply_filters( \'https_local_ssl_verify\', false )
)
) );
wp_remote_post( $cron_request[\'url\'], $cron_request[\'args\'] );
在这里,您还可以看到浮点数的来源:它作为参数传递,以标识瞬态。
没什么好担心的。