gtm4wp_woocommerce_addjs

The Google Tag Manager for WordPress gtm4wp woocommerce addjs function.

Description

gtm4wp_woocommerce_addjs( $js ); 

Parameters (1)

0. $js
The js.

Usage

  1. if ( !function_exists( 'gtm4wp_woocommerce_addjs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-tag-manager-for-wordpress/integration/woocommerce.php'; 
  3.  
  4. // The js. 
  5. $js = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gtm4wp_woocommerce_addjs($js); 
  9.  

Defined (1)

The function is defined in the following location(s).

/integration/woocommerce.php  
  1. function gtm4wp_woocommerce_addjs( $js ) { 
  2. global $woocommerce; 
  3.  
  4. if ( version_compare( $woocommerce->version, "2.1", ">=" ) ) { 
  5. wc_enqueue_js( $js ); 
  6. } else { 
  7. $woocommerce->add_inline_js( $js );