Automattic\WooCommerce\Blocks\Domain\Services
DraftOrders::maybe_create_cronjobs
Maybe create cron events.
Method of the class: DraftOrders{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->maybe_create_cronjobs();
DraftOrders::maybe_create_cronjobs() DraftOrders::maybe create cronjobs code WC 11.3.0
protected function maybe_create_cronjobs() {
if ( ! ActionSchedulerUtil::has_scheduled_action( self::DRAFT_CLEANUP_EVENT_HOOK ) ) {
$midnight_tonight = strtotime( 'midnight tonight' );
if ( false !== $midnight_tonight ) {
as_schedule_recurring_action( $midnight_tonight, DAY_IN_SECONDS, self::DRAFT_CLEANUP_EVENT_HOOK );
}
}
}