Created
March 15, 2015 16:00
-
-
Save besimhu/fd4aaa096ceefdf6addf to your computer and use it in GitHub Desktop.
You can add custom colors to the TINYMCE editor, and this is especially handy if you want clients to stick to their color palette. Please be aware that this function gets rid of all colors and just adds in your selection.
This file contains hidden or 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
// TINYMCE Options | |
function my_mce4_options( $init ) { | |
$custom_colours = ' | |
"db1e34", "Color Name", "222c64", "Color Name Two" | |
'; | |
$init['textcolor_map'] = '['.$custom_colours.']'; | |
$init['textcolor_rows'] = 6; | |
return $init; | |
} | |
add_filter('tiny_mce_before_init', 'my_mce4_options'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment