Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors
StoredStateSetupForProducts::run_on_transition_post_status()
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() StoredStateSetupForProducts::run on transition post status code WC 9.7.1
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(); }