From e25356481dc43fb18bf36c1b4710224f98b2a79a Mon Sep 17 00:00:00 2001 From: Jasper Croome Date: Tue, 16 Apr 2024 22:09:54 -0700 Subject: [PATCH] switching logic for strict eval --- .../goodbids/src/classes/Auctions/Cron.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client-mu-plugins/goodbids/src/classes/Auctions/Cron.php b/client-mu-plugins/goodbids/src/classes/Auctions/Cron.php index af57fd88..0e063118 100644 --- a/client-mu-plugins/goodbids/src/classes/Auctions/Cron.php +++ b/client-mu-plugins/goodbids/src/classes/Auctions/Cron.php @@ -242,14 +242,14 @@ private function schedule_auction_ending_soon_check(): void { add_action( 'init', function (): void { - if (wp_next_scheduled(Auctions::CRON_AUCTION_ENDING_SOON_CHECK_HOOK)){ - return; + if (false === wp_next_scheduled(Auctions::CRON_AUCTION_ENDING_SOON_CHECK_HOOK)){ + // Event is not scheduled, so schedule it. + wp_schedule_event( + strtotime( current_time( 'mysql') ), + $this->cron_intervals['1hr']['name'], + Auctions::CRON_AUCTION_ENDING_SOON_CHECK_HOOK + ); } - wp_schedule_event( - strtotime( current_time( 'mysql') ), - $this->cron_intervals['1hr']['name'], - Auctions::CRON_AUCTION_ENDING_SOON_CHECK_HOOK - ); } ); }