Automattic\WooCommerce\Admin\RemoteInboxNotifications

StoredStateSetupForProducts::run_on_transition_post_status()public staticWC 1.0

Runs when a post status transitions, but we're only interested if it is a product being published.

Method of the class: StoredStateSetupForProducts{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = StoredStateSetupForProducts::run_on_transition_post_status( $new_status, $old_status, $post );
$new_status(string) (required)
The new status.
$old_status(string) (required)
The old status.
$post(Post) (required)
The post.

StoredStateSetupForProducts::run_on_transition_post_status() code WC 8.7.0

public static function run_on_transition_post_status( $new_status, $old_status, $post ) {
	if (
		'product' !== $post->post_type ||
		'publish' !== $new_status
	) {
		return;
	}

	self::update_stored_state_and_possibly_run_remote_notifications();
}