Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active June 16, 2019 08:24
Show Gist options
  • Select an option

  • Save wplit/250b5387464f5dd29000a9c1d8c6f9b5 to your computer and use it in GitHub Desktop.

Select an option

Save wplit/250b5387464f5dd29000a9c1d8c6f9b5 to your computer and use it in GitHub Desktop.
Add Global Colours to WP Editor
// Adds brand colours to editor palette for content editors
add_theme_support( 'editor-color-palette', array(
array(
'name' => 'Primary',
'slug' => 'primary',
'color' => '#db164d', // Replace with your colour
),
array(
'name' => 'Secondary',
'slug' => 'secondary',
'color' => '#111', // Replace with your colour
),
array(
'name' => 'Link Hover',
'slug' => 'link-hover',
'color' => '#c20034', // Replace with your colour
),
) );
// Disables access to all other colors
add_theme_support( 'disable-custom-colors' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment