From 3491a6f6d0e2eb52563a592dc8700f5ac988c97b Mon Sep 17 00:00:00 2001 From: lipemat Date: Tue, 3 Oct 2023 13:10:14 -0500 Subject: [PATCH] Reschedule cron when running wp_cron_run_event If an event is on a schedule, reschedule it instead of simply removing it. --- includes/abstract-testcase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/abstract-testcase.php b/includes/abstract-testcase.php index 1ef0a37de8..c9f73597f6 100644 --- a/includes/abstract-testcase.php +++ b/includes/abstract-testcase.php @@ -425,7 +425,9 @@ protected function _restore_hooks() { public static function flush_cache() { global $wp_object_cache; - wp_cache_flush_runtime(); + if ( function_exists( 'wp_cache_supports' ) && wp_cache_supports( 'flush_runtime' ) ) { + wp_cache_flush_runtime(); + } if ( is_object( $wp_object_cache ) && method_exists( $wp_object_cache, '__remoteset' ) ) { $wp_object_cache->__remoteset();