Automattic\WooCommerce\Admin\RemoteInboxNotifications

StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications()private staticWC 1.0

Enqueues an async action (using action-scheduler) to run remote notifications.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications();

Код StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications() WC 8.7.0

private static function update_stored_state_and_possibly_run_remote_notifications() {
	$stored_state = RemoteInboxNotificationsEngine::get_stored_state();
	// If the stored_state is the same, we don't need to run remote notifications to avoid unnecessary action scheduling.
	if ( true === $stored_state->there_are_now_products ) {
		return;
	}

	$stored_state->there_are_now_products = true;
	RemoteInboxNotificationsEngine::update_stored_state( $stored_state );

	// Run self::run_remote_notifications asynchronously.
	as_enqueue_async_action( self::ASYNC_RUN_REMOTE_NOTIFICATIONS_ACTION_NAME );
}