Astra_Minify::render_fallback_js()

Render Fallback JS


Description


Return

(void)


Source

File: classes/class-astra-minify.php

		public static function render_fallback_js() {

			$js_files    = self::get_js_files();
			$files_count = count( $js_files );

			if ( 0 < $files_count ) {

				self::enqueue_dependent_js();

				foreach ( $js_files as $index => $file_path ) {

					if ( ! file_exists( $file_path ) ) {
						continue;
					}

					$new_file = plugins_url( str_replace( plugin_dir_path( ASTRA_EXT_FILE ), '', $file_path ), ASTRA_EXT_FILE );

					if ( 0 == $index ) {
						$handle = 'astra-addon-js';
					} else {
						$handle = 'astra-addon-js-' . $index;
					}

					wp_enqueue_script(
						$handle,
						$new_file,
						array(),
						ASTRA_EXT_VER,
						true
					);
				}
			}
		}

Changelog

Changelog
Version Description
1.0 Introduced.

User Contributed Notes

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