Last active
April 16, 2019 15:06
-
-
Save seothemes/362131bddd452c1129a92e0331bcf5a5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// Create array of variables default colors | |
$seo_default_colors = array( | |
'color-text' => '#333333', | |
'color-button' => '#333333', | |
'color-link' => '#dddddd', | |
'color-white' => '#ffffff', | |
'color-outline' => '#eeeeee', | |
); | |
// Update SCSS variables | |
function seo_set_variables(){ | |
// Get the default colors | |
global $seo_default_colors; | |
// Create an array of variables | |
$variables = array(); | |
// Loop through each variable and get theme_mod | |
foreach( $seo_default_colors as $key => $value ) { | |
$variables[$key] = get_theme_mod( $key, $value ); | |
} | |
return $variables; | |
} | |
add_filter('wp_scss_variables', 'seo_set_variables'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment