jeff bush
asked 5 years ago

I have a custom button in my visual editor in the backend (I use WP’s default, Tinymce). I would like the custom button to show up in the frontend (in the answer form). Or how do I get the frontend to use the same editor as the backend?

1 Answers
DominicStaff
answered 5 years ago

Hi,
We’ve used the tinyMCE editor of wordpress default, if you want to remove several unused icons, you can add the following code to the function.php file:

add_filter("mce_buttons", "tinymce_editor_buttons", 99); //targets the first line
add_filter("mce_buttons_2", "tinymce_editor_buttons_second_row", 99); //targets the second line

function tinymce_editor_buttons($content) {
return array(
    "undo", 
    "redo", 
    "separator",
    "bold", 
    "italic", 
    "underline", 
    "strikethrough", 
    "dwqaCodeEmbed",
    "separator",
    "bullist", 
    "separator",
    //add more here...
    );
}

function tinymce_editor_buttons_second_row($content) {
   //return an empty array to remove this line
    return array();
}

The button control list can be found here: http://www.tinymce.com/wiki.php/TinyMCE3x:Buttons/controls
Hope this helps !

Powered by DW Question & Answer Pro