最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

visual editor - RTE always on text mode by default

matteradmin9PV0评论

I have installed a theme with visual composer on my wordpress and everything was working fine until I added a widget above the header.

From that moment on, every time I want to create a new entry the RTE is always on text mode instead of visual.

I find it really weird that my customization have caused this, does anyone has another explanation and/or solution?

Thanks in advance!

I have installed a theme with visual composer on my wordpress and everything was working fine until I added a widget above the header.

From that moment on, every time I want to create a new entry the RTE is always on text mode instead of visual.

I find it really weird that my customization have caused this, does anyone has another explanation and/or solution?

Thanks in advance!

Share Improve this question asked Jul 10, 2015 at 7:38 viriatoviriato 1111 silver badge6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Can't really think of a reason for the behaviour, maybe it is just a bug in the theme, of course I can't say anything specific without knowing the code. But you should be able get around it by making use of the wp_default_editor hook and explicitly set the type of editor you want to show first, which is inside the function with the same name, so wp_default_editor().

function wpse194059_set_wp_default_editor( $editor ) {
  // possible values are: 
  // tinymce - visual mode
  // html - text mode
  return 'tinymce';
}
add_filter( 'wp_default_editor', 'wpse194059_set_wp_default_editor' );
Post a comment

comment list (0)

  1. No comments so far