Instantly share code, notes, and snippets.

@jonschr jonschr/functions.php
Last active Feb 8, 2019

Embed
What would you like to do?
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