From 97c2ca75cdece41cad1f592b635d4f6b91b110a2 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Fri, 9 Dec 2022 13:29:56 -0500 Subject: [PATCH] Return a mock scheduled event object when preventing cron scheduling --- inc/performance_optimizations/namespace.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/performance_optimizations/namespace.php b/inc/performance_optimizations/namespace.php index 64243890..b4f2cb37 100644 --- a/inc/performance_optimizations/namespace.php +++ b/inc/performance_optimizations/namespace.php @@ -73,5 +73,9 @@ function schedule_events_in_admin( $pre, string $hook ) { return $pre; } - return true; + // Non-empty filter return values are expected by wp_next_scheduled to have + // a numeric ->timestamp property. + return (object) [ + 'timestamp' => time() + HOUR_IN_SECONDS, + ]; }