Created
March 18, 2018 08:35
-
-
Save nfsarmento/26ee6c854f07cb46a544b00f8f8bc82b to your computer and use it in GitHub Desktop.
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
function ns_mce4_options($init) { | |
$custom_colours = ' | |
"3366FF", "Color 1 name", | |
"CCFFCC", "Color 2 name", | |
"FFFF00", "Color 3 name", | |
"99CC00", "Color 4 name", | |
"FF0000", "Color 5 name", | |
"FF99CC", "Color 6 name", | |
"CCFFFF", "Color 7 name" | |
'; | |
// build colour grid default+custom colors | |
$init['textcolor_map'] = '['.$custom_colours.']'; | |
// change the number of rows in the grid if the number of colors changes | |
// 8 swatches per row | |
$init['textcolor_rows'] = 1; | |
return $init; | |
} | |
add_filter('tiny_mce_before_init', 'ns_mce4_options'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment