Hide Block Editor

Support General Hide Block EditorResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #34682
    zenjukai@gmail.com[email protected]
    Participant

    Hey folks,

    New to metabox and scratching my head on how to hide the default block editor when using a custom fields. In ACF you have an option to hide/remove the block editor, comments, discussion, post type, etc -- but for the life of me I cannot find anything on this with metabox.

    Any thoughts? Cheers

    #34697
    Long NguyenLong Nguyen
    Moderator

    Hi,

    For the custom post type, you can go to tab Supports when creating/editing the post type to disable block editor, comments ...

    Refer to this documentation https://docs.metabox.io/creating-post-types/#supports-settings

    #35178
    zenjukai@gmail.com[email protected]
    Participant

    Hey Long,

    Thank you for your reply and yes, I know I can do that with the custom post type. But what if I do not use a post type and just creating a custom fields for say a view template?

    What I am ding is using metabox as a page builder -- so I would create a custom field group and them show it on a specific page. What I don't want showing up is the extra content editor, as I will have specific areas where the page content will be.

    Are you able to do that? Or does it require a custom post type?

    Cheers

    #35191
    Long NguyenLong Nguyen
    Moderator

    Hi,

    For the default post and page of WordPress, Meta Box does not have an option to remove the default content box. But you can try to use this code to remove it.

    // Remove the editor. Change 'post' to your custom post type.
    add_action( 'init', function () {
        remove_post_type_support( 'post', 'editor' );
    } );

    Refer to this tutorial https://docs.metabox.io/save-wysiwyg-content-post-content/

    #35201
    zenjukai@gmail.com[email protected]
    Participant

    Perfect, thank you Long, that will do the trick. =)

    Cheers

    #45453
    Bertus de LeeuwBertus de Leeuw
    Participant

    This is not working with classic editor...

    #45454
    zenjukai@gmail.com[email protected]
    Participant

    Still works fine for me. Make sure you change 'post' to 'page' if you are wanting it to work on your pages.

    If you need it for both posts and pages, then use this.

    // Remove the editor. Change 'post' to your custom post type.
    add_action( 'init', function () {
        remove_post_type_support( 'post', 'editor' );
        remove_post_type_support( 'page', 'editor' );
    } );
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.