@@ -26,7 +26,9 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * Prevent loading the library more than once |
| 28 | 28 | */ |
| 29 | -if( defined( 'WP_DYNAMIC_CSS' ) ) return; |
|
| 29 | +if( defined( 'WP_DYNAMIC_CSS' ) ) { |
|
| 30 | + return; |
|
| 31 | +} |
|
| 30 | 32 | define( 'WP_DYNAMIC_CSS', true ); |
| 31 | 33 | |
| 32 | 34 | /** |
@@ -184,7 +184,9 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | $css = file_get_contents( $style['path'] ); |
| 187 | - if( $style['minify'] ) $css = $this->minify_css( $css ); |
|
| 187 | + if( $style['minify'] ) { |
|
| 188 | + $css = $this->minify_css( $css ); |
|
| 189 | + } |
|
| 188 | 190 | |
| 189 | 191 | // Compile the dynamic CSS |
| 190 | 192 | $compiled_css = $this->compile_css( |
@@ -310,9 +312,17 @@ discard block |
||
| 310 | 312 | */ |
| 311 | 313 | protected function strtoval( &$str ) |
| 312 | 314 | { |
| 313 | - if( 'false' === strtolower($str) ) $str = false; |
|
| 314 | - if( 'true' === strtolower($str) ) $str = true; |
|
| 315 | - if( false !== strrpos( $str, "'" ) ) $str = str_replace ( "'", "", $str ); |
|
| 316 | - if( is_numeric( $str ) ) $str = floatval( $str ); |
|
| 315 | + if( 'false' === strtolower($str) ) { |
|
| 316 | + $str = false; |
|
| 317 | + } |
|
| 318 | + if( 'true' === strtolower($str) ) { |
|
| 319 | + $str = true; |
|
| 320 | + } |
|
| 321 | + if( false !== strrpos( $str, "'" ) ) { |
|
| 322 | + $str = str_replace ( "'", "", $str ); |
|
| 323 | + } |
|
| 324 | + if( is_numeric( $str ) ) { |
|
| 325 | + $str = floatval( $str ); |
|
| 326 | + } |
|
| 317 | 327 | } |
| 318 | 328 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | /** |
| 142 | 142 | * Register a value retrieval function and associate it with the given handle |
| 143 | 143 | * |
| 144 | - * @param type $handle The stylesheet's name/id |
|
| 144 | + * @param string $handle The stylesheet's name/id |
|
| 145 | 145 | * @param type $callback |
| 146 | 146 | */ |
| 147 | 147 | public function register_callback( $handle, $callback ) |
@@ -151,6 +151,9 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | 153 | * Register a filter function for a given stylesheet handle. |
| 154 | + * @param string $handle |
|
| 155 | + * @param string $filter_name |
|
| 156 | + * @param callable $callback |
|
| 154 | 157 | */ |
| 155 | 158 | public function register_filter( $handle, $filter_name, $callback ) |
| 156 | 159 | { |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | * Update the compiled CSS for the given handle. |
| 58 | 58 | * |
| 59 | 59 | * @param string $handle The handle of the stylesheet |
| 60 | - * @param type $compiled_css |
|
| 60 | + * @param string $compiled_css |
|
| 61 | 61 | */ |
| 62 | 62 | public function update( $handle, $compiled_css ) |
| 63 | 63 | { |