Automattic\WooCommerce\Admin\API

AnalyticsImports::get_next_scheduled_time │ private │ WC 1.0

Get the next scheduled time for the batch processor.

Метод класса: AnalyticsImports{}

Хуков нет.

Возвращает

string|null. Datetime string in site timezone or null if not scheduled.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_next_scheduled_time();

Код AnalyticsImports::get_next_scheduled_time() WC 11.2.2

private function get_next_scheduled_time() {
	$action_hook = OrdersScheduler::get_action( OrdersScheduler::PROCESS_PENDING_ORDERS_BATCH_ACTION );
	if ( ! is_string( $action_hook ) ) {
		return null;
	}
	$next_time = WC()->queue()->get_next( $action_hook, array(), (string) OrdersScheduler::$group );

	if ( ! $next_time ) {
		return null;
	}

	// Convert UTC timestamp to site timezone.
	return get_date_from_gmt( $next_time->format( 'Y-m-d H:i:s' ), 'Y-m-d H:i:s' );
}