Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been looking for a way to add a button to wrap text in for the WYSIWYG editor in Wordpress 3.3.1.

I tried this:

function enable_more_buttons($buttons) {
 $buttons[] = 'code';
 return $buttons;
}
add_filter("mce_buttons_3", "enable_more_buttons");

But that did not work as expected. It did display a button, but it brings up a popup window to edit the HTML.

In addition to it would be nice to have and .

share|improve this question
    
With TinyMCE, "code" refers to the markup of the textbox itself. It's supposed to launch a popup window to edit the HTML. You need a way to add a custom button, because there isn't a baked-in "preformatted" feature. I recommend asking on Stack Overflow instead, because this is TinyMCE-related, not WordPress-related, and will be closed as off-topic soon enough. –  EAMann Jan 31 '12 at 22:51
    
I finally found a plugin that did just what I wanted - a button for <code> in the WYSIWYG editor: WYSIWYG Inline Code Command –  thomthom Jan 31 '12 at 23:27
    
Please post your answer as a new Answer below and accept it so others can learn what you did. Providing a link out to the plugin would also be useful. –  EAMann Feb 1 '12 at 0:23
    
Ah - sorry. Posted in the wrong textbox. –  thomthom Feb 1 '12 at 11:47
add comment

1 Answer

up vote 3 down vote accepted

I finally found a plugin that did just what I wanted - a button for in the WYSIWYG editor: WYSIWYG Inline Code Command

share|improve this answer
    
Mark the question as answered please. –  toscho Feb 6 '12 at 11:26
    
Done! Thanks for reminding me. It wouldn't let me mark it when I first posted. Had to wait 24 hours - forgot. –  thomthom Feb 6 '12 at 13:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.