diff options
author | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-07-21 14:54:07 -0500 |
commit | 9d4123cee1867ee7199b06bdc92d40611f547ecc (patch) | |
tree | 6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php | |
download | blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2 blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip |
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php')
-rw-r--r-- | inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php b/inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php new file mode 100644 index 0000000..59ef2de --- /dev/null +++ b/inc/builder/type/header/edd-cart/class-astra-header-edd-cart-loader.php @@ -0,0 +1,53 @@ +<?php +/** + * EDD Cart Styling Loader for Astra theme. + * + * @package astra-builder + * @author Astra + * @copyright Copyright (c) 2020, Astra + * @link https://wpastra.com/ + * @since 3.0.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +/** + * Customizer Initialization + * + * @since 3.0.0 + */ +class Astra_Header_Edd_Cart_Loader { + + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() { + + add_action( 'customize_preview_init', array( $this, 'preview_scripts' ), 110 ); + } + + /** + * Customizer Preview + * + * @since 3.0.0 + */ + public function preview_scripts() { + /** + * Load unminified if SCRIPT_DEBUG is true. + */ + /* Directory and Extension */ + $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified'; + $file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min'; + wp_enqueue_script( 'astra-header-builder-edd-cart-customizer-preview-js', ASTRA_HEADER_EDD_CART_URI . '/assets/js/' . $dir_name . '/customizer-preview' . $file_prefix . '.js', array( 'customize-preview', 'astra-customizer-preview-js' ), ASTRA_THEME_VERSION, true ); + } + +} + +/** +* Kicking this off by creating the object of the class. +*/ +new Astra_Header_Edd_Cart_Loader(); |