Skip to content

Commit

Permalink
Make WP_ENV check a positive if statement to improve semantics and re…
Browse files Browse the repository at this point in the history
…adability
  • Loading branch information
cfxd committed Jul 10, 2014
1 parent 4cdab44 commit c024221
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ function roots_scripts() {
* The build task in Grunt renames production assets with a hash
* Read the asset names from assets-manifest.json
*/
if (WP_ENV !== 'development') {
if (WP_ENV === 'development') {
$assets = array(
'css' => '/assets/css/main.css',
'js' => '/assets/js/scripts.js',
'modernizr' => '/assets/vendor/modernizr/modernizr.js',
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js'
);
} else {
$get_assets = file_get_contents(get_template_directory() . '/assets/manifest.json');
$assets = json_decode($get_assets, true);
$assets = array(
Expand All @@ -28,13 +35,6 @@ function roots_scripts() {
'modernizr' => '/assets/js/vendor/modernizr.min.js',
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'
);
} else {
$assets = array(
'css' => '/assets/css/main.css',
'js' => '/assets/js/scripts.js',
'modernizr' => '/assets/vendor/modernizr/modernizr.js',
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js'
);
}

wp_enqueue_style('roots_css', get_template_directory_uri() . $assets['css'], false, null);
Expand Down

0 comments on commit c024221

Please sign in to comment.