File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
33 * @package WordPress Dynamic CSS
4- * @version 1.0.2
4+ * @version 1.0.3
55 * @author Askupa Software <[email protected] > 66 * @link https://github.com/askupasoftware/wp-dynamic-css
77 * @copyright 2016 Askupa Software
@@ -174,8 +174,13 @@ protected function filter_external( $style )
174174 */
175175 protected function compile_css ( $ css , $ callback )
176176 {
177- return preg_replace_callback ( '#\$([\w]+)# ' , function ( $ matches ) use ( $ callback ) {
178- return call_user_func_array ( $ callback , array ($ matches [1 ]) );
177+ return preg_replace_callback ( "# \\$([ \\w-]+)((?: \\['?[ \\w-]+'? \\])*)# " , function ( $ matches ) use ( $ callback ) {
178+ // If this variable is an array, get the subscripts
179+ if ( '' !== $ matches [2 ] )
180+ {
181+ preg_match_all ('/[\w-]+/i ' , $ matches [2 ], $ subscripts );
182+ }
183+ return call_user_func_array ( $ callback , array ($ matches [1 ],@$ subscripts [0 ]) );
179184 }, $ css );
180185 }
181186}
You can’t perform that action at this time.
0 commit comments