How to Add Custom Colors in Editor's Color Picker

Add Tool

Add Custom Colors in Editor's Color Picker


Add Custom Colors in Editor's Color Picker

How to add custom colors in editor’s color picker? Is it possible to add more colors in WordPress editor color picker? Yes as a WordPress developer it is possible to add more and more color in WordPress editor color picker. This short snippet will add three colors (#15375c, #3366FF and #9fb83f) to color picker of WordPress editor. It’s pretty useful if you allow administrators and authors to select the common colors of your website. Simply add this below WordPress snippets into your theme’s functions.php to Add Custom Colors in Editor's Color Picker.

function devtoolsplus_custom_palette( $colors ) {
    // Default WordPres color pallete
    $colors['theme_advanced_text_colors'] = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';
    // New colors that we want to add
    $colors['theme_advanced_text_colors'] .= ',15375c,3366FF,9fb83f';
 
    // make it true to enable the "more" option
    $colors['theme_advanced_more_colors'] = false;
    return $colors;
}
add_filter('tiny_mce_before_init', 'devtoolsplus_custom_palette');

After adding this snippets into you functions.php file check your WordPress editor color picker. Your WordPress color picker will like above image

You must see: How to add custom meta box in post

WordPress editor color picker customization

Edit Default WordPress color pallete: If you want to delete default WordPress color pallete simply find // Default WordPres color pallete and add or delete color code from below line. Add New colors in WordPress color pallete: If you want to Add new WordPress color pallete simply find 15375c,3366FF,9fb83f and add or delete color code separate by comma. Add more color option: If you want to add more color option button simply edit $colors['theme_advanced_more_colors'] = false; and make it true.


Tags: custom colors, white house custom color, install wordpress, WordPress developer, Add Custom Colors in Editor's Color Picker, color picker, html color picker
Payza

About Masum Billah

Add Custom Colors in Editor's Color Picker 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: How to Add Custom Colors in Editor's Color Picker


adf.ly