X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/1c09677af04c9e37714e09b73eb9dbc5b2e3eb13..4f9d63e13cd8c6e275797c75b401b074b82937bc:/wp-includes/cron.php diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 416803a9..921f8c86 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -130,10 +130,15 @@ function wp_unschedule_event( $timestamp, $hook, $args = array() ) { * @since 2.1.0 * * @param string $hook Action hook, the execution of which will be unscheduled. - * @param mixed $args,... Optional. Event arguments. + * @param array $args Optional. Arguments that were to be pass to the hook's callback function. */ -function wp_clear_scheduled_hook( $hook ) { - $args = array_slice( func_get_args(), 1 ); +function wp_clear_scheduled_hook( $hook, $args = array() ) { + // Backward compatibility + // Previously this function took the arguments as discrete vars rather than an array like the rest of the API + if ( !is_array($args) ) { + _deprecated_argument( __FUNCTION__, '3.0.0', __('This argument has changed to an array to match the behavior of the other cron functions.') ); + $args = array_slice( func_get_args(), 1 ); + } while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook, $args ); @@ -219,7 +224,7 @@ function spawn_cron( $local_time = 0 ) { while ( @ob_end_flush() ); flush(); - @include_once(ABSPATH . 'wp-cron.php'); + WP_DEBUG ? include_once( ABSPATH . 'wp-cron.php' ) : @include_once( ABSPATH . 'wp-cron.php' ); return; }