|
5 | 5 | */
|
6 | 6 | function stormbringer_js_theme() {
|
7 | 7 |
|
8 |
| - //wp_enqueue_script( 'stormbringer-common', get_template_directory_uri() . '/js/src/common.js', array( 'jquery' ), null, true ); |
9 |
| - |
10 |
| - $jsfile = 'js/scripts.js'; |
11 |
| - $version = null; |
12 |
| - |
13 |
| - // Preprocessor |
14 |
| - $preprocessor = get_theme_mod('bootstrap_preprocessor', true); |
15 |
| - |
16 |
| - if ( $preprocessor === 'less' ) { |
17 |
| - } |
18 |
| - |
19 |
| - if ( $preprocessor === 'scss' || $preprocessor == 1) { |
20 |
| - $grunt_assets = get_theme_mod('grunt_assets'); |
21 |
| - if ( current_user_can( 'administrator' ) || @$_GET['scsscompile'] == '1' ) { |
22 |
| - } |
23 |
| - else{ |
24 |
| - $jsfile = 'js/scripts.min.js'; |
25 |
| - $version = time(); |
26 |
| - //if(isset($grunt_assets[$jsfile])) { |
27 |
| - // $jsfile = $grunt_assets[$jsfile]; |
28 |
| - //} |
29 |
| - } |
30 |
| - } |
31 |
| - wp_enqueue_script( 'theme', get_stylesheet_directory_uri() . '/'.$jsfile, array( 'jquery' ), $version, true ); |
| 8 | + //wp_enqueue_script( 'stormbringer-common', get_template_directory_uri() . '/js/src/common.js', array( 'jquery' ), null, true ); |
| 9 | + |
| 10 | + $jsfile = 'js/scripts.js'; |
| 11 | + $version = null; |
| 12 | + |
| 13 | + // Preprocessor |
| 14 | + $preprocessor = get_theme_mod( 'bootstrap_preprocessor', true ); |
| 15 | + |
| 16 | + if ( $preprocessor === 'less' ) { |
| 17 | + } |
| 18 | + |
| 19 | + if ( $preprocessor === 'scss' || $preprocessor == 1 ) { |
| 20 | + $grunt_assets = get_theme_mod( 'grunt_assets' ); |
| 21 | + if ( current_user_can( 'administrator' ) || @$_GET['scsscompile'] == '1' ) { |
| 22 | + $version = time(); |
| 23 | + } else { |
| 24 | + $jsfile = 'js/scripts.min.js'; |
| 25 | + |
| 26 | + if ( isset( $grunt_assets[ $jsfile ] ) ) { |
| 27 | + $jsfile = $grunt_assets[ $jsfile ]; |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + wp_enqueue_script( 'theme', get_stylesheet_directory_uri() . '/' . $jsfile, array( 'jquery' ), $version, true ); |
32 | 32 |
|
33 | 33 | }
|
34 | 34 | add_action( 'wp_enqueue_scripts', 'stormbringer_js_theme', 300 );
|
|
0 commit comments