how can i disable metaboxes if gutenberg editor is enabled

Support General how can i disable metaboxes if gutenberg editor is enabled

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44149
    brkardbrkard
    Participant

    Hi.

    I am using classic editor for clients because most of them hate gutenburg block editor. So stil use classic editor for clients with metabox help.

    But if they want to switch to block editor, i dont want use metaboxes

    So how can i disable metaboxes if gutenburg block editor is enabled.

    Can anyone help me about this ?

    Thanks.

    #44152
    PeterPeter
    Moderator

    Hello,

    Do you mean deactivating the plugin Meta Box if the Block editor is enabled? Or a specific meta box (field group) on your site?

    #44153
    brkardbrkard
    Participant

    I mean specific meta box (field group) on your site?

    For example i made a metabox field group that inserts hero image with classic editor.

    I want to disable ( not cosmetic hide ) , completely disable this field group if user switch to block editor.

    Thanks

    #44160
    PeterPeter
    Moderator

    Hello,

    You might need to use the code to check the block or classic editor is available when editing the post and registering the meta box. For example:

    if( code_check_editor_here ) {
        add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    }
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            ...
        ];
    
        return $meta_boxes;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.