Make WordPress Core

Opened 4 years ago

Closed 14 months ago

#49803 closed enhancement (invalid)

Allow for add_theme_support( 'editor-color-palette' ) to append to default palette

Reported by: wolfpaw's profile wolfpaw Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords: close
Focuses: ui Cc:


Currently, you can use add_theme_support( 'editor-color-palette' ) to create a new palette of colors to choose from while editing posts. I'd like the ability to append custom colors to the palette, as opposed to entirely replacing the existing palette.

Change History (2)

#1 @noisysocks
3 years ago

  • Keywords close added
  • Version set to 5.0

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.

$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.

#2 @JeffPaul
14 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.