Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::run_on_transition_post_status()publicWC 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.

Return

null. Nothing.

Usage

$CustomerEffortScoreTracks = new CustomerEffortScoreTracks();
$CustomerEffortScoreTracks->run_on_transition_post_status(;

CustomerEffortScoreTracks::run_on_transition_post_status() code WC 7.1.0

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();
	}
}