Astra_Enqueue_Scripts::theme_assets()

List of all assets.


Description


Return

(array) assets array.


Source

File: inc/core/class-astra-enqueue-scripts.php

		public static function theme_assets() {

			$default_assets = array(
				// handle => location ( in /assets/js/ ) ( without .js ext).
				'js'  => array(
					'astra-theme-js' => 'style',
				),
				// handle => location ( in /assets/css/ ) ( without .css ext).
				'css' => array(
					'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'style-flex' : 'style',
				),
			);

			if ( true === Astra_Builder_Helper::$is_header_footer_builder_active ) {

				$default_assets = array(
					// handle => location ( in /assets/js/ ) ( without .js ext).
					'js'  => array(
						'astra-theme-js' => 'frontend',
					),
					// handle => location ( in /assets/css/ ) ( without .css ext).
					'css' => array(
						'astra-theme-css' => Astra_Builder_Helper::apply_flex_based_css() ? 'main' : 'frontend',
					),
				);

				if ( defined( 'ASTRA_EXT_VER' ) && version_compare( ASTRA_EXT_VER, '3.5.9', '<' ) ) {
					$default_assets['js']['astra-theme-js-pro'] = 'frontend-pro';
				}

				if ( Astra_Builder_Helper::is_component_loaded( 'edd-cart', 'header' ) ||
					Astra_Builder_Helper::is_component_loaded( 'woo-cart', 'header' ) ) {
					$default_assets['js']['astra-mobile-cart'] = 'mobile-cart';
				}
			}
			return apply_filters( 'astra_theme_assets', $default_assets );
		}


User Contributed Notes

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