Permalink
Browse files

No need to run extra code to check if 'style.min.css' exists if SCRIP…

…T_DEBUG is enabled.
  • Loading branch information...
1 parent c46ad69 commit 5177409491d04b43b2bf48c21fa6342f5a65120b @justintadlock committed Dec 20, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 functions/styles.php
View
@@ -140,17 +140,19 @@ function hybrid_get_styles() {
function hybrid_min_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri ) {
/* Use the .min stylesheet if SCRIPT_DEBUG is turned off. */
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
+ if ( !defined( 'SCRIPT_DEBUG' ) || false === SCRIPT_DEBUG ) {
+ $suffix = '.min';
- /* Remove the stylesheet directory URI from the file name. */
- $stylesheet = str_replace( trailingslashit( $stylesheet_dir_uri ), '', $stylesheet_uri );
+ /* Remove the stylesheet directory URI from the file name. */
+ $stylesheet = str_replace( trailingslashit( $stylesheet_dir_uri ), '', $stylesheet_uri );
- /* Change the stylesheet name to 'style.min.css'. */
- $stylesheet = str_replace( '.css', "{$suffix}.css", $stylesheet );
+ /* Change the stylesheet name to 'style.min.css'. */
+ $stylesheet = str_replace( '.css', "{$suffix}.css", $stylesheet );
- /* If the stylesheet exists in the stylesheet directory, set the stylesheet URI to the dev stylesheet. */
- if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $stylesheet ) )
- $stylesheet_uri = trailingslashit( $stylesheet_dir_uri ) . $stylesheet;
+ /* If the stylesheet exists in the stylesheet directory, set the stylesheet URI to the dev stylesheet. */
+ if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $stylesheet ) )
+ $stylesheet_uri = trailingslashit( $stylesheet_dir_uri ) . $stylesheet;
+ }
/* Return the theme stylesheet. */
return $stylesheet_uri;

0 comments on commit 5177409

Please sign in to comment.