TinyMCE Editor Set Default Tab

I removed the tabs from the WP editor using

wp_editor('', 'some-id', array('quicktags' => false) );

But sometimes when the page loads the TinyMCE field loads with the Text tab selected:

Read More

Rather than the HTML tab:

Is there a way maybe with JS / JQuery to make sure the tab is always the visual
HTML tab?

Already tried:

add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );

Related posts

2 comments

  1. I came across this page — http://wp-snippets.com/set-default-editor/ * — which looks promising, though a little out of date. Instead of their code, I would suggest trying this:

    add_filter( 'wp_default_editor', 'wpse101200_default_editor' );
    function wpse101200_default_editor( $editor ) {
        return 'tinymce';
    }
    

    Reference

    WPSeek’s wp_default_editor() page
    wp_default_editor() in the WordPress core source

    Unfortunately, the Codex doesn’t currently have a wp_default_editor() page.

    __
    * Apparently so did you. I missed that the first time I read your question.

  2. My solution.
    I found that the problem was a JS WP setting.
    A refresh of the page was required to make the editors initialise with the
    new setting

    <script>
    if (getUserSetting('editor') != "tinymce") {
        setUserSetting('editor', 'tinymce');
        location.reload();
    }
    </script>
    

Comments are closed.