Astra_Ext_Woocommerce_Loader::customize_register_old( WP_Customize_Manager $wp_customize )

Add postMessage support for site title and description for the Theme Customizer.


Description


Parameters

$wp_customize

(WP_Customize_Manager) (Required) Theme Customizer object.


Source

File: addons/woocommerce/classes/class-astra-ext-woocommerce-loader.php

		public function preview_scripts() {

			if ( SCRIPT_DEBUG ) {
				$js_path = 'assets/js/unminified/customizer-preview.js';
			} else {
				$js_path = 'assets/js/minified/customizer-preview.min.js';
			}

			wp_register_script( 'ast-woocommerce-customizer-preview', ASTRA_ADDON_EXT_WOOCOMMERCE_URI . $js_path, array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_EXT_VER, true );

			$localize_array = array(
				'cart_hash_key' => WC()->ajax_url() . '-wc_cart_hash',
			);

			wp_localize_script( 'ast-woocommerce-customizer-preview', 'ast_woocommerce', $localize_array );

			wp_enqueue_script( 'ast-woocommerce-customizer-preview' );
		}
	}
}

/**
* Kicking this off by calling 'get_instance()' method
*/
Astra_Ext_Woocommerce_Loader::get_instance();

User Contributed Notes

You must log in before being able to contribute a note or feedback.