Created
May 14, 2015 17:38
-
-
Save dovy/2e57d6d5138d36efbe6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function compiler_action( $options, $css, $changed_values ) { | |
$keys = array( | |
'header_color', | |
'header_footer_color' | |
); | |
$compile = false; | |
foreach ( $changed_values as $key => $value ) { | |
if ( in_array( $key, $keys ) ) { | |
$compile = true; | |
} | |
} | |
if ($compile) { | |
$string = ""; | |
foreach ( $options as $key => $value ) { | |
if ( in_array( $key, $keys ) ) { | |
$string .= "@" . $key . ':' . $value . ';'; | |
} | |
} | |
// RUN LESS COMPILER | |
} | |
echo '<h1>The compiler hook has run!</h1>'; | |
echo "<pre>"; | |
print_r( $changed_values ); // Values that have changed since the last save | |
echo "</pre>"; | |
//print_r($options); //Option values | |
//print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment