Last active
February 8, 2019 22:28
-
-
Save jonschr/dadd9ca9d0b46ac8e0c3144739b1349d to your computer and use it in GitHub Desktop.
Registering colors for use with Guetenberg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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