Visual Editor Background

You can either create a plugin or a child theme. Since the black background on your site is most likely coming from a theme, a child theme seems like a good fit here – so if you ever changed your theme, the black background in the Editor would also go away. To create a child … Read more

Working With Visual Composer VC_Single_Image

It’s not easy to trace trough the code behind [vc_single_image], because for start it uses the extract, that’s not recommended in WordPress or PHP in general. The image attribute value is stripped for non-integers into the $img_id variable. With your setup, there’s a call to wpb_getImageBySize( array( ‘attach_id’ => $img_id, … ), that seems to … 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

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

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