Skip to content

Instantly share code, notes, and snippets.

@jonschr
Last active February 8, 2019 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonschr/dadd9ca9d0b46ac8e0c3144739b1349d to your computer and use it in GitHub Desktop.
Save jonschr/dadd9ca9d0b46ac8e0c3144739b1349d to your computer and use it in GitHub Desktop.
Registering colors for use with Guetenberg
/**
* Set the theme colors
*/
add_action( 'after_setup_theme', 'prefix_register_colors' );
function prefix_register_colors() {
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Black', 'prefix_textdomain' ),
'slug' => 'black',
'color' => '#333',
),
array(
'name' => esc_html__( 'Blue', 'prefix_textdomain' ),
'slug' => 'blue',
'color' => '#669BC9',
),
array(
'name' => esc_html__( 'Light', 'prefix_textdomain' ),
'slug' => 'light',
'color' => '#eef2f5',
),
array(
'name' => esc_html__( 'Yellow', 'prefix_textdomain' ),
'slug' => 'yellow',
'color' => '#c3a144',
),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment