[wp-trac] [WordPress Trac] #49803: Allow for add_theme_support( 'editor-color-palette' ) to append to default palette
WordPress Trac
noreply at wordpress.org
Tue Nov 24 04:40:41 UTC 2020
#49803: Allow for add_theme_support( 'editor-color-palette' ) to append to default
palette
-------------------------+------------------------------
Reporter: wolfpaw | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.0
Severity: normal | Resolution:
Keywords: close | Focuses: ui
-------------------------+------------------------------
Changes (by noisysocks):
* keywords: => close
* version: => 5.0
Comment:
Hi @wolfpaw. You should be able to do this by calling
`get_theme_support()`, appending to the return value, and then calling
`add_theme_support()` again.
{{{#!php
$editor_color_palette = get_theme_support( 'editor-color-palette' );
$editor_color_palette[] = array( ...whatever... );
add_theme_support( 'editor-color-palette', $editor_color_palette );
}}}
I don't think that a dedicated API for this is necessary.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49803#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list