Astra_Addon_Customizer::enqueue_scripts()

Enqueue Admin Scripts


Description


Source

File: classes/customizer/class-astra-addon-customizer.php

		public function enqueue_scripts() {

			$dir_name    = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
			$file_prefix = ( SCRIPT_DEBUG ) ? '' : '.min';
			$js_uri      = ASTRA_EXT_URI . 'classes/customizer/assets/js/';

			wp_enqueue_style( 'ast-ext-admin-settings', ASTRA_EXT_URI . 'admin/assets/css/customizer-controls.css', array(), ASTRA_EXT_VER );

			if ( ! SCRIPT_DEBUG ) {
				// Enqueue Customizer script.
				$custom_controls_deps = array(
					'jquery',
					'customize-base',
					'jquery-ui-tabs',
					'jquery-ui-sortable',
					'wp-i18n',
					'wp-components',
					'wp-element',
					'wp-media-utils',
					'wp-block-editor',
				);

				wp_enqueue_script( 'astra-addon-custom-control-script', $js_uri . 'custom-controls.min.js', $custom_controls_deps, ASTRA_EXT_VER, true );

			} else {

				// Enqueue Customizer React.JS script.
				$custom_controls_react_deps = array(
					'astra-custom-control-plain-script',
					'wp-i18n',
					'wp-components',
					'wp-element',
					'wp-media-utils',
					'wp-block-editor',
				);

				wp_enqueue_script( 'astra-addon-custom-control-react-script', ASTRA_EXT_URI . 'classes/customizer/extend-controls/build/index.js', $custom_controls_react_deps, ASTRA_EXT_VER, true );
			}
		}

Changelog

Changelog
Version Description
3.1.0 Introduced.

User Contributed Notes

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