Automattic\WooCommerce\Internal\Admin

CustomerEffortScoreTracks::run_on_load_edit_php()publicWC 1.0

Determine on initiating CES survey on searching for product or orders.

Метод класса: CustomerEffortScoreTracks{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

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

Код CustomerEffortScoreTracks::run_on_load_edit_php() WC 8.7.0

public function run_on_load_edit_php() {
	$allowed_types = array( 'product', 'shop_order' );
	$post_type     = get_current_screen()->post_type;

	// We're only interested for certain post types.
	if ( ! in_array( $post_type, $allowed_types, true ) ) {
		return;
	}

	// Determine whether request is search by "s" GET parameter.
	if ( empty( $_GET['s'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.Recommended
		return;
	}

	$page_now = 'edit-' . $post_type;
	$this->enqueue_ces_survey_for_search( $post_type, $page_now, 'edit-php' );
}