tinyMCE duplicates previous block element when pressing return (visual editor)

I’m currently having the same problem. Here’s my work-around. add_filter( ‘tiny_mce_before_init’, ‘workaround’ ); public function workaround( $in ) { $in[‘force_br_newlines’] = true; $in[‘force_p_newlines’] = false; $in[‘forced_root_block’] = ”; return $in; } tiny_mce_before_init gives you access to the TinyMCE settings that WordPress’ editor uses. See also: TinyMCEConfiguration The downside to this is instead of “return” resulting … Read more

Remove double space after a period

I cannot offer a JavaScript solution, because I am not sure where exactly this is happening. But … we can hook into wp_insert_post_data and solve this issue in PHP: add_filter( ‘wp_insert_post_data’, ‘t5_strip_double_spaces’, 20 ); function t5_strip_double_spaces( $data ) { $data[‘post_content’] = preg_replace( “~( \x{C2}\x{A0}|\x{C2}\x{A0} )~m”, ‘ ‘, $data[‘post_content’] ); return $data; } As plugin on … Read more

How To Hide The Visual And Html Editor Completely?

For posts: add_action(‘init’, ‘my_custom_init’); function my_custom_init() { remove_post_type_support( ‘post’, ‘editor’ ); } See Codex. For custom post types that you register, you can specify what ‘features’ it supports when you register it it use the ‘supports’ arguments. For custom post types that are not registered by you can use the above with ‘post’ replaced by … Read more

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

Add visual editor to Media Edit Screen

This function added to functions.php does exactly that: // Enables Editor in Media edit screen. function add_editor_support_for_attachments($settings) { if( get_post_type() == ‘attachment’){ $quicktags_settings = array( ‘buttons’ => ‘strong,em,link,block,del,ins,ul,ol,li,code,close’ ); $settings = array( ‘wpautop’ => true, ‘textarea_name’ => ‘content’, ‘textarea_rows’ => 10, ‘media_buttons’ => false, ‘tinymce’ => true, ‘quicktags’ => $quicktags_settings, ); return $settings; } } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)