Automattic\WooCommerce\Blocks\Domain\Services
DraftOrders::maybe_create_cronjobs
Maybe create cron events.
Метод класса: DraftOrders{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->maybe_create_cronjobs();
Код DraftOrders::maybe_create_cronjobs() DraftOrders::maybe create cronjobs WC 11.0.1
protected function maybe_create_cronjobs() {
$has_scheduled_action = function_exists( 'as_has_scheduled_action' ) ? 'as_has_scheduled_action' : 'as_next_scheduled_action';
if ( false === call_user_func( $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 );
}
}
}