Snippet: Use classes instead of inline styles for text alignment

WordPress’ TinyMCE (WYSIWYG) editor is adding inline stlyes to the markup when you change the text alignment. This behaviour is hard coded in wp-includes/class-wp-editor.php. Can the inline styles be changed to classes instead? 2 Answers 2 Note This answer was originally included in @bitstarr’s question above and was included as a separate answer here to … Read more

Resizing the width of the WYSIWYG editor

Just a simple question here but though my googling and searching efforts haven’t found the answer to it. I’m wanting to re-size the width of my WordPress WYSIWYG editor to be 650px. What do I have to type into functions.php to get this effect? I found this but it didn’t do anything add_action(‘admin_print_styles-edit.php’,’increase_textarea_css’); add_action(‘admin_print_styles-post-new.php’,’increase_textarea_css’); function … Read more

Adding a button to the WYSIWYG editor?

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 … Read more

How can I filter Microsoft Word gunk from pasted content?

I have some users who are posting to a group blog and are able to cut-and-paste but their pastes include things like: <!– /* Font Definitions */ @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 … Read more