How-to stop wordpress from saving utf8 non-breaking space characters

Both initial creation and updates for the posts pass through wp_insert_post_data (among other filters). You can modify post_content item in array passed to make the replacement you need, before it proceeds on to be saved in database. Update Code pasted from comments add_filter( ‘wp_insert_post_data’, ‘rm_wp_insert_post_data’, ’99’, 2 ); function rm_wp_insert_post_data ( $data , $postarr ) … Read more

Lost formatting after saving

After a lot of research (2 day) i finally found a plaster… it’s not a fix, but it make the editor work for most of the work. Here is the code to add to function.php of the theme: function cbnet_tinymce_config( $init ) { $init[‘remove_linebreaks’] = false; $init[‘convert_newlines_to_brs’] = true; $init[‘remove_redundant_brs’] = false; return $init; } … Read more

How to enable user_can_rich_edit for guests?

Just add the can_richedit capability to the user you want to be able to use the editor. You can use the Capability Manager to do it. Update: to enable the rich editor on anonymous/guest users, add this to your funcitons.php or anywhere you like, just make sure it comes before the wp_editor() call. add_filter(‘user_can_richedit’, ‘__return_true’);

WordPress shortcut to switch from Visual to Text mode and vice versa

There are no shortcuts, but you could add some by eg adding accesskeys to the editor html generated (in your theme’s “functions.php”): function mytheme_edit_form_after_title( $post ) { ob_start(); } function mytheme_edit_form_after_editor( $post ) { echo str_replace( array( ‘id=”content-tmce”‘, ‘id=”content-html”‘ ), array( ‘id=”content-tmce” accesskey=”V”‘, ‘id=”content-html” accesskey=”E”‘ ), // ‘T’ already used for ‘Insert Read More tag’. … Read more