I know there are similar topics with accepted answers but I can’t find what I’m looking for. I want to keep only basic buttons in wp_editor()
. I’m using this in an option page to make writing more comfortable.
The problem is the theme adds a huge amount of quicktags I do not want on this specific page. How can I achieve this.
So far I’ve looked into wp-includes/wp-class-editor.php
but the following line does not remove unecessary buttons :
'quicktags' => array('buttons' => 'link,ins,img,close')
:/ Any help would be much appreciated.
EDIT: I’ve tried to modify function given in similar topic with this :
function wpa_47010( $qtInit ) {
global $my_plugin_page;
$screen = get_current_screen();
if( $screen->id == $my_plugin_page )
$qtInit['buttons'] = 'link,img,close';
return $qtInit;
}
add_filter('quicktags_settings', 'wpa_47010');
But it does not work !
If you are using the settings API, you can use exactly the same code for calling wp_editor as you would anywhere else
I’ve test the code below, it adds a setting section to the reading section, and then adds a field to the section containing a WYSIWYG editor with buttons limited to link, img and close
The following code works for me, it adds an options page, and adds a WYSIWYG box to that page, with ONLY 3 quicktags: link, img and close, and nothing else.
Note, I turned of tinyMCE, and passed a settings array (which contains another array for quicktag settings) to wp_editor.
By passing in unique id of the textarea field, it will only affect the correct box on your plugin options page