Skip to content
Advertisement

WordPress: how to hide toolbar in post editor?

I have a Custom Post Type (Products) in my WordPress web site.

This is a WooCommerce Product, if it’s necessary to know.

I need to hide toolbar (1) into wp-editor on Add Product page. Also I need to hide “Add media” button (2) and “Visual/Text” tabs (3).

How do I hide them?

Maybe it make sense to change this WordPress Editor to the textarea with the same value of “name” attribute with using of some hooks?

how to hide toolbar in post editor?

Advertisement

Answer

I have found this solution:

    function hide_toolbar_TinyMCE( $in ) {
        $in['toolbar1'] = '';
        $in['toolbar2'] = '';
        $in['toolbar'] = false;
        return $in; 
    }
    add_filter( 'tiny_mce_before_init', 'hide_toolbar_TinyMCE' );

But it hide toolbar everywhere, because this is “filter” but not “action”. How do I hide it only on Product (Custom Post Type) Add/Edit page?

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement