Need help removing some quicktags
-
Have tried every suggestion/code snippet I could find between the Codex, the forum here, and StackExchange, all without success.
I’m trying to *remove* a QuickTag button added by WP-Tiles (which is a phenomenal plugin but sadly the developer does not provide support, just updates). We don’t want non-admins to be able to see/use that button.
SO I’ve tried both using a filter to specify which buttons I do want:
add_filter('quicktags_settings', 'my_format_quicktags', 200); function my_format_quicktags( $qtInit ) { $qtInit['buttons'] = 'strong,em,link,block,ul,ol,li,more,spell,close'; return $qtInit; }
You’ll notice I added what I *think* is a pretty high priority number so that it would fire *after* the plugin loads it’s button, but no dice. I get no errors, and the (default) buttons I did NOT include in my list don’t appear so I know the code works BUT the WP-Tiles shortcode button still appears.
So I tried using wp_editor() with this code:
$settings = array( 'quicktags' => array( 'buttons' => 'strong,em,link,block,ul,ol,li,more,spell,close' ) ); wp_editor($input, 'ed_toolbar', $settings);
BUT this throws an error:
Fatal error: Call to undefined function get_userdata() in /[…]/wp-includes/user.php on line 386
I have no idea why – what does the wp_editor have to do with getting user data?
Also on the second code snippet, I’m not sure that I’m using it correctly – the Codex info seems to *imply* that I need to replace “$editor_id” with the actual ID of the editor component I’m targeting, but the examples are not entirely clear.
I could really use some help with this – we have authors who keep messing around with that button and breaking our layout, so I really need to just remove it entirely – I managed to remove it from the TinyMCE buttons on the Visual Editor, but struggling to get it out of the QuickTags on the HTML/Text Editor.
Any help would be most appreciated!
- The topic ‘Need help removing some quicktags’ is closed to new replies.