Should the WP post editor B (bold) button be inserting a tag instead of in HTML5?

Here’s what I came up with. So far it doesn’t seem to have broken anything: add_filter(‘tiny_mce_before_init’, ‘modify_formats’); function modify_formats($settings){ $formats = array( ‘bold’ => array(‘inline’ => ‘b’), ‘italic’ => array(‘inline’ => ‘i’) ); $settings[‘formats’] = json_encode( $formats ); return $settings; } One could easily have used plus a class here, but given the changes in … Read more

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

Custom edit post column – category not showing

Here I tested this code and its working fine and steps here. I am just creating a dummy custom_post_type here book with the following code. function kv_custom_post_books() { $args = array( ‘public’ => true, ‘label’ => ‘Books’, ‘taxonomies’ => array(‘category’, ‘post_tag’) , ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’ ) ); register_post_type( ‘book’, $args ); } … 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

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