Created
September 18, 2021 18:15
-
-
Save bnecreative/bf7b68e054d6c3c48bc376f604db4c51 to your computer and use it in GitHub Desktop.
Sweetness - Theme Color Palette
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 // Don't copy this line... | |
/* | |
* Theme Color Palette | |
* | |
* Allows adjusting the default palette for WP blocks. | |
* Colors are also made available with CSS variables automatically. | |
* | |
* Location /includes/setup.php:188 | |
* | |
* Returns $colors | |
* | |
*/ | |
add_filter( 'bne_theme_color_palette', function( $colors ) { | |
// Remove Bootstrap colors | |
unset( $colors['success'] ); | |
unset( $colors['danger'] ); | |
unset( $colors['warning'] ); | |
unset( $colors['info'] ); | |
// Add a new color | |
$colors['custom1'] = array( | |
'name' => 'Custom Green', | |
'slug' => 'custom1', | |
'color' => '#28a745', | |
); | |
// Add a new color | |
$colors['custom2'] = array( | |
'name' => 'Custom Purple', | |
'slug' => 'custom2', | |
'color' => '#a72ec9', | |
); | |
// Return color palette | |
return $colors; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment