Skip to content

Instantly share code, notes, and snippets.

@bnecreative
Created September 18, 2021 18:15
Show Gist options
  • Save bnecreative/bf7b68e054d6c3c48bc376f604db4c51 to your computer and use it in GitHub Desktop.
Save bnecreative/bf7b68e054d6c3c48bc376f604db4c51 to your computer and use it in GitHub Desktop.
Sweetness - Theme Color Palette
<?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