0
votes

I have an issue where the Wordpress Editor tabs 'Visual' and 'Text' are not visible. I have tried all the below:

  • Disabled All Plugins
  • Enabled TwentyNinteen Plugin
  • Installed and Activated TinyMCE Advanced Plugin
  • Added define('CONCATENATE_SCRIPTS', false);
  • From Profile Settings I tried toggling 'Disable the visual editor when writing', saving every time I toggle the setting

All the above did not work and Editor tabs are still not showing. When in local environment everything works fine.

1

1 Answers

1
votes

The issue seemed to be with the user-agent, there is a whole article about it: https://benjaminhorn.io//code/wordpress-visual-editor-not-visible-because-of-user-agent-sniffing/

Basically the filter below sorted my issue:

<?php
/**
* Overrides the function user_can_richedit and only checks the
* user preferences instead of doing UA sniffing.
*
* @return bool
*/
function user_can_richedit_custom() {
    global $wp_rich_edit;

    if (get_user_option('rich_editing') == 'true' || !is_user_logged_in()) {
        $wp_rich_edit = true;
        return true;
    }

    $wp_rich_edit = false;
    return false;
}
add_filter('user_can_richedit', 'user_can_richedit_custom');