diff --git a/wp-includes/cron.php b/wp-includes/cron.php index 416803a9b..b31e83565 100644 --- a/wp-includes/cron.php +++ b/wp-includes/cron.php @@ -130,10 +130,13 @@ 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) ) + $args = array_slice( func_get_args(), 1 ); while ( $timestamp = wp_next_scheduled( $hook, $args ) ) wp_unschedule_event( $timestamp, $hook, $args );