Merge pull request #1085 from CFXd/make-wp_env-check-positive-if-statement
Make WP_ENV check a positive if statement to improve semantics and readability
This commit is contained in:
@@ -19,7 +19,14 @@ function roots_scripts() {
|
|||||||
* The build task in Grunt renames production assets with a hash
|
* The build task in Grunt renames production assets with a hash
|
||||||
* Read the asset names from assets-manifest.json
|
* 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');
|
$get_assets = file_get_contents(get_template_directory() . '/assets/manifest.json');
|
||||||
$assets = json_decode($get_assets, true);
|
$assets = json_decode($get_assets, true);
|
||||||
$assets = array(
|
$assets = array(
|
||||||
@@ -28,13 +35,6 @@ function roots_scripts() {
|
|||||||
'modernizr' => '/assets/js/vendor/modernizr.min.js',
|
'modernizr' => '/assets/js/vendor/modernizr.min.js',
|
||||||
'jquery' => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.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);
|
wp_enqueue_style('roots_css', get_template_directory_uri() . $assets['css'], false, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user