From 6c32331adec025336cad6dea0f0eec5d9984c574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Ko=CC=88nemann?= Date: Thu, 1 Dec 2016 20:46:15 +0100 Subject: [PATCH] =?UTF-8?q?Adding=20dynamic=20version=20info=20behind=20Un?= =?UTF-8?q?derStrap=20asset=C2=B4s=20URL=C2=B4s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/enqueue.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/inc/enqueue.php b/inc/enqueue.php index f22c2f9..89c9910 100644 --- a/inc/enqueue.php +++ b/inc/enqueue.php @@ -5,17 +5,18 @@ * @package understrap */ + + if ( ! function_exists( 'understrap_scripts' ) ) { /** * Load theme's JavaScript sources. */ function understrap_scripts() { - wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), - '0.5.0' ); + // Get the theme data + $the_theme = wp_get_theme(); + wp_enqueue_style( 'understrap-styles', get_stylesheet_directory_uri() . '/css/theme.min.css', array(), $the_theme->get( 'Version' ) ); wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), '0.5.0', - true ); - + wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . '/js/theme.min.js', array(), $the_theme->get( 'Version' ), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } @@ -31,7 +32,7 @@ if ( ! function_exists( 'understrap_scripts' ) ) { } if ( is_page_template( ( 'page-templates/vertical-one-page.php' ) || is_home() || is_single() ) && $loadit ) { wp_enqueue_script( 'vertical-one-page', get_template_directory_uri() . '/js/vertical-one-page.js', - array( 'jquery' ), '0.5.0', true ); + array( 'jquery' ), true ); $page_for_posts = strtolower( get_the_title( get_option( 'page_for_posts' ) ) ); $home_url = home_url(); $is_single = is_single(); @@ -67,7 +68,7 @@ if ( is_active_sidebar( 'hero' ) ) : ); wp_enqueue_script( 'understrap-slider-script', - get_stylesheet_directory_uri() . '/js/slider_settings.js', array(), '0.5.0' ); + get_stylesheet_directory_uri() . '/js/slider_settings.js', array() ); wp_localize_script( 'understrap-slider-script', 'understrap_slider_variables', $data ); } }