@@ -22,19 +22,19 @@ |
||
| 22 | 22 | |
| 23 | 23 | require_once 'renderer.php'; |
| 24 | 24 | |
| 25 | -if( !function_exists('wp_dynamic_css_enqueue') ) |
|
| 25 | +if (!function_exists('wp_dynamic_css_enqueue')) |
|
| 26 | 26 | { |
| 27 | - function wp_dynamic_css_enqueue( $path ) |
|
| 27 | + function wp_dynamic_css_enqueue($path) |
|
| 28 | 28 | { |
| 29 | 29 | $dcss = DynamicCSSRenderer::get_instance(); |
| 30 | - $dcss->enqueue_style( $path ); |
|
| 30 | + $dcss->enqueue_style($path); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if( !function_exists('wp_dynamic_css_set_callback') ) |
|
| 34 | +if (!function_exists('wp_dynamic_css_set_callback')) |
|
| 35 | 35 | { |
| 36 | - function wp_dynamic_css_set_callback( $callback ) |
|
| 36 | + function wp_dynamic_css_set_callback($callback) |
|
| 37 | 37 | { |
| 38 | - add_filter( 'wp_dynamic_css_get_variable_value', $callback ); |
|
| 38 | + add_filter('wp_dynamic_css_get_variable_value', $callback); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function init() |
| 56 | 56 | { |
| 57 | - add_action( 'wp_print_styles', array( $this, 'print_compiled_style' ) ); |
|
| 57 | + add_action('wp_print_styles', array($this, 'print_compiled_style')); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * |
| 63 | 63 | * @param type $path The absolute path to the dynamic style |
| 64 | 64 | */ |
| 65 | - public function enqueue_style( $path ) |
|
| 65 | + public function enqueue_style($path) |
|
| 66 | 66 | { |
| 67 | 67 | $this->styles[] = $path; |
| 68 | 68 | } |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | public function print_compiled_style() |
| 74 | 74 | { |
| 75 | 75 | ob_start(); |
| 76 | - foreach( $this->styles as $style ) |
|
| 76 | + foreach ($this->styles as $style) |
|
| 77 | 77 | { |
| 78 | 78 | include $style; |
| 79 | 79 | echo "\n"; |
| 80 | 80 | } |
| 81 | - $css = $this->parse_css( ob_get_clean() ); |
|
| 81 | + $css = $this->parse_css(ob_get_clean()); |
|
| 82 | 82 | include 'style.phtml'; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | * @return string The compiled CSS after converting the variables to their |
| 94 | 94 | * corresponding values |
| 95 | 95 | */ |
| 96 | - public function parse_css( $css ) |
|
| 96 | + public function parse_css($css) |
|
| 97 | 97 | { |
| 98 | 98 | return preg_replace_callback('#\$([\w]+)#', function($matches) { |
| 99 | - return apply_filters( 'wp_dynamic_css_get_variable_value', $matches[1]); |
|
| 99 | + return apply_filters('wp_dynamic_css_get_variable_value', $matches[1]); |
|
| 100 | 100 | }, $css); |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | \ No newline at end of file |