WC_Products_Tracking::possibly_add_attribute_tracking_scripts()publicWC 1.0

Adds the tracking scripts for product attributes filtering actions.

Method of the class: WC_Products_Tracking{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Products_Tracking = new WC_Products_Tracking();
$WC_Products_Tracking->possibly_add_attribute_tracking_scripts( $hook );
$hook(string) (required)
Page hook.

WC_Products_Tracking::possibly_add_attribute_tracking_scripts() code WC 8.7.0

public function possibly_add_attribute_tracking_scripts( $hook ) {
	// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification
	if (
		'product_page_product_attributes' !== $hook ||
		! isset( $_GET['page'] ) ||
		'product_attributes' !== wp_unslash( $_GET['page'] )
	) {
		return;
	}
	// phpcs:enable

	WCAdminAssets::register_script( 'wp-admin-scripts', 'attributes-tracking', false );
}