Astra_Ext_Blog_Pro_Markup::add_scripts()
Add scripts.
Description
Return
(void.)
Source
File: addons/blog-pro/classes/class-astra-ext-blog-pro-markup.php
public function add_scripts() {
/*** Start Path Logic */
/* Define Variables */
$uri = ASTRA_EXT_BLOG_PRO_URI . 'assets/js/';
$path = ASTRA_EXT_BLOG_PRO_DIR . 'assets/js/';
/* Directory and Extension */
$file_prefix = '.min';
$dir_name = 'minified';
if ( SCRIPT_DEBUG ) {
$file_prefix = '';
$dir_name = 'unminified';
}
$js_uri = $uri . $dir_name . '/';
$js_dir = $path . $dir_name . '/';
if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) {
$gen_path = $js_uri;
} else {
$gen_path = $js_dir;
}
/*** End Path Logic */
$blog_layout = astra_get_option( 'blog-layout' );
$blog_grid = astra_get_option( 'blog-grid' );
$blog_grid_layout = astra_get_option( 'blog-grid-layout' );
$astra_blog_masonry = astra_get_option( 'blog-masonry' );
if ( ( 'blog-layout-1' == $blog_layout && 1 != $blog_grid ) || ( 'blog-layout-1' != $blog_layout && 1 != $blog_grid_layout ) ) {
// Enqueue scripts.
if ( $astra_blog_masonry ) {
Astra_Minify::add_dependent_js( 'jquery' );
Astra_Minify::add_dependent_js( 'jquery-masonry' );
Astra_Minify::add_js( $gen_path . 'ast-ext-blog-pro' . $file_prefix . '.js' );
}
}
}
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0 | Introduced. |