WC_Products_Tracking::possibly_add_attribute_tracking_scripts()publicWC 1.0

Adds the tracking scripts for product attributes filtering actions.

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

Хуков нет.

Возвращает

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

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

$WC_Products_Tracking = new WC_Products_Tracking();
$WC_Products_Tracking->possibly_add_attribute_tracking_scripts( $hook );
$hook(строка) (обязательный)
Page hook.

Код WC_Products_Tracking::possibly_add_attribute_tracking_scripts() 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 );
}