Hi @waldirb
Thanks you for flagging this issue. It looks like I need to make a few updates to the plugin for this to work properly. I have a release coming in the next week or so and I will include a fix for this within that.
In the meantime, here’s how you should be able to get around it.
The first thing is to call your add_theme_support later than the plugin adds theme colors. The below code in your functions.php file should do the trick.
add_action( 'admin_init', function() {
add_theme_support('editor-color-palette', array(
array( 'name' => 'my-color', 'color' => '#000', 'slug' => 'my-color' ),
) );
}, 100 );
The above should switch the theme colors throughout all of the core WordPress blocks. If you would like to add your theme colors to the blocks used in All Bootstrap Blocks you will need to make an update within the plugins code. To do this go to /plugins/all-bootstrap-blocks/helpers.php and change the function on line 525 (areoi_get_option_colors) from this:
function areoi_get_option_colors()
{
global $areoi_theme_colors;
return array(
array( 'name' => 'primary', 'color' => $areoi_theme_colors['primary'] ),
array( 'name' => 'secondary', 'color' => $areoi_theme_colors['secondary'] ),
array( 'name' => 'success', 'color' => $areoi_theme_colors['success'] ),
array( 'name' => 'info', 'color' => $areoi_theme_colors['info'] ),
array( 'name' => 'warning', 'color' => $areoi_theme_colors['warning'] ),
array( 'name' => 'danger', 'color' => $areoi_theme_colors['danger'] ),
array( 'name' => 'light', 'color' => $areoi_theme_colors['light'] ),
array( 'name' => 'dark', 'color' => $areoi_theme_colors['dark'] ),
array( 'name' => 'body', 'color' => $areoi_theme_colors['body'] ),
array( 'name' => 'white', 'color' => '#fff' ),
);
}
To this:
function areoi_get_option_colors()
{
global $areoi_theme_colors;
$colors = array(
array( 'name' => 'primary', 'color' => $areoi_theme_colors['primary'] ),
array( 'name' => 'secondary', 'color' => $areoi_theme_colors['secondary'] ),
array( 'name' => 'success', 'color' => $areoi_theme_colors['success'] ),
array( 'name' => 'info', 'color' => $areoi_theme_colors['info'] ),
array( 'name' => 'warning', 'color' => $areoi_theme_colors['warning'] ),
array( 'name' => 'danger', 'color' => $areoi_theme_colors['danger'] ),
array( 'name' => 'light', 'color' => $areoi_theme_colors['light'] ),
array( 'name' => 'dark', 'color' => $areoi_theme_colors['dark'] ),
array( 'name' => 'body', 'color' => $areoi_theme_colors['body'] ),
array( 'name' => 'white', 'color' => '#fff' ),
);
$existing = get_theme_support( 'editor-color-palette' );
return array_merge( $existing, $colors );
}
This will prepend your theme colors to the Bootstrap colors. Hopefully this resolves your issue in the short term but I will look for a more elegant solution and include it in the next release and send you another update.
Let me know if this doesn’t solve your problem and I can take another look. Thanks again for reaching out.
Miles