Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::run_on_transition_post_statuspublicWC 1.0

Hook into the post status lifecycle, to detect relevant user actions that we want to survey about.

Method of the class: CustomerEffortScoreTracks{}

No Hooks.

Returns

null. Nothing (null).

Usage

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->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.

CustomerEffortScoreTracks::run_on_transition_post_status() code WC 10.3.3

public function run_on_transition_post_status(
	$new_status,
	$old_status,
	$post
) {
	if ( 'product' === $post->post_type ) {
		$this->maybe_enqueue_ces_survey_for_product( $new_status, $old_status );
	} elseif ( 'shop_order' === $post->post_type ) {
		$this->enqueue_ces_survey_for_edited_shop_order();
	}
}