gtm4wp_reload_options

The Google Tag Manager for WordPress gtm4wp reload options function.

Description

gtm4wp_reload_options(); 

Usage

  1. if ( !function_exists( 'gtm4wp_reload_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-tag-manager-for-wordpress/common/readoptions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gtm4wp_reload_options(); 
  7.  

Defined (1)

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

/common/readoptions.php  
  1. function gtm4wp_reload_options() { 
  2. global $gtm4wp_defaultoptions; 
  3.  
  4. $storedoptions = (array) get_option( GTM4WP_OPTIONS ); 
  5. if ( ! is_array( $gtm4wp_defaultoptions ) ) { 
  6. $gtm4wp_defaultoptions = array(); 
  7.  
  8. // update WooCommerce settings from 0.7.x to 0.8 
  9. if ( isset( $storedoptions[ GTM4WP_OPTION_INTEGRATE_WOOCOMMERCE ] ) && ! isset( $storedoptions[ GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC ] ) ) { 
  10. $storedoptions[ GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC ] = false; 
  11.  
  12. unset( $storedoptions[ GTM4WP_OPTION_INTEGRATE_WOOCOMMERCE ] ); 
  13.  
  14. return array_merge( $gtm4wp_defaultoptions, $storedoptions );