• In TinyMCE I used to add a custom color palette function to my functions.php file so I could restrict the color options available to editors. Here was my code:

    function my_mce4_options( $init ) {
    $default_colours = '
    "103A5C", "Dark Blue",
    "144C93", "Med Blue",
    "CEE7FF", "Light Blue",
    "68AAF2", "Bright Blue"
    "222222", "Almost Black",
    "444444", "Slate Gray",
    "666666", "Charcoal",
    "e6e6e6", "Light Gray",
    "cacaca", "Medium Gray",
    "fefefe", "Almost White",
    "ffffff", "White"
    ';
    $init['textcolor_map'] = '['.$default_colours.']';
    $init['textcolor_rows'] = 2;
    $init['textcolor_cols'] = 6;
    
    return $init;
    }
    add_filter('tiny_mce_before_init', 'my_mce4_options');

    This code now causes problems with the Classic Editor plugin and Advanced Editor Tools. I get the white text on white background in the visual editor window, and no buttons. After much debugging I discovered that this code is the culprit.

    So my question is how can I accomplish this now?

  • The topic ‘Custom color palette’ is closed to new replies.