Home>Support>Remove HTML tab from tinymce editor

Remove HTML tab from tinymce editor

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi!

I’m working actually with SiteOrigin. I’m looking for remove the HTML tab from tinymce editor. Actually i was looking to this link: https://siteorigin.com/docs/widgets-bundle/form-building/form-fields/#heading-tinymce

The thing is that, i don’t know what i should use in the next code:

...
'quicktags_settings' => array( $this, 'filter_quicktags_settings' )
...

How can i pass the information needed for removing completely the HTML editor tab or, at least, all tags?

Thanks so much in advance!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Andres,

    Just to clarify, is this for a widget you’re creating or is this a general request (as in you’re not creating a widget)?

  2. 9 years, 1 month ago Andres Reyes Navas

    Hi Alex!:

    Yes, we’re doing a widget bundle for customize administration widget panels for ease the work for non programmer people. Just to clarify:

    1. We’ve enabled a tinymce editor in order to contribute a header title and so on

    'title_text' => array(
                  'type' => 'tinymce',
                  'label' => __('Title text', 'rand-widgets-bundle'),
                  'rows' => 3,
                  'button_filters' => array(
                    'mce_buttons' => array( $this, 'tinymce_editor_buttons' ),
                    'mce_buttons_2' => array( $this, 'tinymce_editor_buttons_2' )
                  ),
                ),
    

    2. Then, the functions related to ‘mce_buttons’ and ‘mce_buttons_2’ are the next ones:

      function tinymce_editor_buttons($buttons) {
        return array(
          "undo",
          "redo",
          "separator",
          "bold",
          "italic",
          "underline",
          "strikethrough",
        );
      }
    
      function tinymce_editor_buttons_2($buttons) {
        return array("forecolor");
      }
    

    So the next thing i wanna do, is disabling HTML tab from tinymce editor, to restrict the use of the editor and forbid the feature in order to edit with HTML tags. I’ve seen how to do it through CSS, (with display:none), but this solution is really dirty as well as less optimized compared to not render the tab at all. Any recommendation?

    Thanks so much in advance!

  3. 8 years, 11 months ago chakzefir

    I’ve got the same problem. Trying to use a function like classic WP filter, but nothings happen.

    function blank_quicktag() {
        $settings['quicktags'] = false;
        return $settings;
    }
    

    I found only one way, to globally destroy html editor in whole web-site.

     
    function my_editor_settings($settings) {
        $settings['quicktags'] = false;
        return $settings;
    }
    add_filter('wp_editor_settings', 'my_editor_settings');
    
Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More