Avoid converting “>” to >

Filtering the_content function wpse72941_content_filter( $content ) { $new_content=””; foreach( preg_split( ‘/((\r?\n)|(\r\n?))/’, $content ) as $line ) { $new_content .= preg_replace( ‘/^>/’, ‘>’, $line ) . ‘\r\n’; } return $new_content; } add_filter( ‘the_content’, ‘wpse72941_content_filter’, 1 ); I don’t know your markdown plugin – for the above approach, I have assumed that the markdown is interpreted after … Read more

Adding a rich text editor to Excerpt

Just replace the default output. Make sure you unescape the excerpt before you send it to the editor: add_action( ‘add_meta_boxes’, array ( ‘T5_Richtext_Excerpt’, ‘switch_boxes’ ) ); /** * Replaces the default excerpt editor with TinyMCE. */ class T5_Richtext_Excerpt { /** * Replaces the meta boxes. * * @return void */ public static function switch_boxes() { … Read more

Editor removes tags

I had problems with TinyMCE Advanced. I struggled with this for a while. Finally discovered a simple solution – Use Shortcodes! Place this code into functions.php and enter [br] wherever you want a br tag to appear. add_shortcode(“br”, “br_tag”); function br_tag(){ return(“<br/>”); }

Why is the visual editor in WordPress limiting the width by wrapping the content?

Hazarding a guess at what you really mean, I suppose you mean something like this is happening: If that is what you’re referring to, that’s because your theme has an editor-style.css stylesheet that’s getting used in the visual editor. Somewhere inside that stylesheet is something like this: html .mceContentBody { max-width:640px; } Removing that or … Read more

Extra TinyMCE editor strips and tags?

I recently got this working. You should search and replace metaname with your meta box name. The key to maintaining formatting was using wpautop(); when saving the data. add_action( ‘add_meta_boxes’, ‘add_metaname_box’); add_action( ‘save_post’, ‘metaname_save’); function add_metaname_box() { add_meta_box( ‘metaname_id’, __( ‘metaname text’, ‘metaname_textdomain’), ‘metaname_custom_box’, ‘page’ ); } function metaname_custom_box() { global $post; wp_nonce_field( plugin_basename( __FILE__ … Read more

How do I move to end of line in Vim?

Just the $ (dollar sign) key. You can use A to move to the end of the line and switch to editing mode (Append). To jump the last non-blank character, you can press g then _ keys. The opposite of A is I (Insert mode at beginning of line), as an aside. Pressing just the ^ will place your cursor at the first non-white-space character of the line.