1 | <?php |
||
24 | class DynamicCSSCompiler |
||
|
|||
25 | { |
||
26 | /** |
||
27 | * @var Singleton The reference to *Singleton* instance of this class |
||
28 | */ |
||
29 | private static $instance; |
||
30 | |||
31 | /** |
||
32 | * @var array The list of dynamic styles paths to compile |
||
33 | */ |
||
34 | private $styles = array(); |
||
35 | |||
36 | /** |
||
37 | * Returns the *Singleton* instance of this class. |
||
38 | * |
||
39 | * @return Singleton The *Singleton* instance. |
||
40 | */ |
||
41 | public static function get_instance() |
||
51 | |||
52 | /** |
||
53 | * Initiate the compiler by hooking to wp_print_styles |
||
54 | */ |
||
55 | public function init() |
||
59 | |||
60 | /** |
||
61 | * Add a style path to the pool of styles to be compiled |
||
62 | * |
||
63 | * @param type $path The absolute path to the dynamic style |
||
64 | */ |
||
65 | public function enqueue_style( $path ) |
||
69 | |||
70 | /** |
||
71 | * Parse all styles in $this->styles and print them |
||
72 | */ |
||
73 | public function print_compiled_style() |
||
84 | |||
85 | /** |
||
86 | * Parse the given CSS string by converting the variables to their |
||
87 | * corresponding values retrieved by applying the filter |
||
88 | * wp_dynamic_css_get_variable_value. |
||
89 | * |
||
90 | * @param string $css A string containing dynamic CSS (pre-compiled CSS with |
||
91 | * variables) |
||
92 | * @uses wp_dynamic_css_get_variable_value filter |
||
93 | * @return string The compiled CSS after converting the variables to their |
||
94 | * corresponding values |
||
95 | */ |
||
96 | public function parse_css( $css ) |
||
102 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.