Codex tools: Log in
WordPress is bundled with the open source HTML WYSIWYG editor TinyMCE by Moxiecode Systems, AB.
Contents |
Looking for more buttons in the WYSIWYG editor? You can Show/Hide the Advanced Editor Toolbar in the standard Wordpress installation and unlock a dozen or so extra buttons, including "Paste as Plain Text" and "Paste from Word". When the Advanced Editor Toolbar is enabled, there is a toggle button available to turn it off. However, when it is off, you must use Alt-V (IE) or Shift-Alt-V (Firefox) to toggle the advanced buttons back "on".
In WP version 3.3.1 the correct toggle command for IE and Firefox is Shift-Alt-Z.
There is a simple (if you understand the Plugin API and hooks) means of adding your own buttons to TinyMCE in WordPress on the TinyMCE Custom Buttons page. See also Plugin API Rich Text Editor Filters for more information.
If the Advanced Editing Toolbar buttons are not sufficient, and writing your own buttons isn't your thing, perhaps you're looking for a plugin to extend the functionality of the TinyMCE editor. Examples include:
You can find more in the WordPress Plugin Directory.
By default Wordpress & the TinyMCE WYSIWYG editor will automatically add paragraph tags ( P tags or <p> ) around line breaks. This default functionality was installed to assist new users in adhering to standard coding principles.
For many advanced users there are times when the additional spacing caused by paragraph tags interferes with the overall design of the site. For these users the ability to remove the automatic use of P tags or a specific use of P tags is required.
In the case where P tags are disabled completely the user will then be responsible for manually adding paragraph tags themselves via the Text editor instead.
There are 3 primary options for removing P tags. These include:
Options Include:
You may also find plugins to assist with this at Wordpress Plugins
If you want to customize which buttons are shown in the editor, or you want to use a custom css file to stylize the visual editor contents, or to prevent tinyMCE from removing styles, spans, etc.. or to customize every aspect of TinyMCE, you can modify the init settings array with the use of the filter tiny_mce_before_init.
You can see the default settings in /wp-includes/class-wp-editor.php here are my preferences.
function myformatTinyMCE($in)
{
$in['remove_linebreaks']=false;
$in['gecko_spellcheck']=false;
$in['keep_styles']=true;
$in['accessibility_focus']=true;
$in['tabfocus_elements']='major-publishing-actions';
$in['media_strict']=false;
$in['paste_remove_styles']=false;
$in['paste_remove_spans']=false;
$in['paste_strip_class_attributes']='none';
$in['paste_text_use_dialog']=true;
$in['wpeditimage_disable_captions']=true;
$in['plugins']='inlinepopups,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen';
$in['content_css']=get_template_directory_uri() . "/editor-style.css";
$in['wpautop']=true;
$in['apply_source_formatting']=false;
$in['theme_advanced_buttons1']='formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,wp_fullscreen,wp_adv';
$in['theme_advanced_buttons2']='pastetext,pasteword,removeformat,|,charmap,|,outdent,indent,|,undo,redo';
$in['theme_advanced_buttons3']='';
$in['theme_advanced_buttons4']='';
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );