diff --git a/src/wp-includes/cron.php b/src/wp-includes/cron.php index 8660e32267..4726a8d474 100644 --- a/src/wp-includes/cron.php +++ b/src/wp-includes/cron.php @@ -76,7 +76,7 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array(), $wp_error * @since 5.1.0 * @since 5.7.0 The `$wp_error` parameter was added, and a `WP_Error` object can now be returned. * - * @param null|bool|WP_Error $pre Value to return instead. Default null to continue adding the event. + * @param null|bool|WP_Error $result The value to return instead. Default null to continue adding the event. * @param stdClass $event { * An object containing an event's data. * diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php index ebb709fec9..e5ecee093b 100644 --- a/tests/phpunit/tests/cron.php +++ b/tests/phpunit/tests/cron.php @@ -456,7 +456,7 @@ class Tests_Cron extends WP_UnitTestCase { /** * Filter the scheduling of events to use the preflight array. */ - public function filter_pre_schedule_event_filter( $null, $event ) { + public function filter_pre_schedule_event_filter( $result, $event ) { $key = md5( serialize( $event->args ) ); $this->preflight_cron_array[ $event->timestamp ][ $event->hook ][ $key ] = array( @@ -465,6 +465,7 @@ class Tests_Cron extends WP_UnitTestCase { 'args' => $event->args, ); uksort( $this->preflight_cron_array, 'strnatcasecmp' ); + return true; }