Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors
StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications
Enqueues an async action (using action-scheduler) to run remote notifications.
Method of the class: StoredStateSetupForProducts{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications();
StoredStateSetupForProducts::update_stored_state_and_possibly_run_remote_notifications() StoredStateSetupForProducts::update stored state and possibly run remote notifications code WC 10.6.2
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 );
}