From c0242218f8ff62b45ab23149473008bfd15aee32 Mon Sep 17 00:00:00 2001 From: Michael Silber Date: Thu, 10 Jul 2014 10:49:21 -0400 Subject: [PATCH] Make WP_ENV check a positive if statement to improve semantics and readability --- lib/scripts.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/scripts.php b/lib/scripts.php index 924c0c5..4fb3c30 100644 --- a/lib/scripts.php +++ b/lib/scripts.php @@ -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( @@ -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);