• Resolved stijndemulder

    (@stijndemulder)


    Hi,

    I can’t seem to hide the meta box in the new/edit (custom) post.

    I read this is an issue with Gutenberg. Is there any solution to this that isn’t “disable gutenberg” ??

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    if you’re referring to passing false the metabox_cb custom callback field, then I’m not aware of any working solution there, and it definitely comes from the Gutenberg end more than CPTUI end. I believe it’s a breaking change that they accepted.

    Thread Starter stijndemulder

    (@stijndemulder)

    Yes, indeed.

    So no solution or workaround possible?

    Would like to add checkbox or radio buttons to let them choose in stead of (auto)fill in the taxonomy.
    Also they should not be able to add new taxonomy through the post but only direct in taxonomy.

    Open for suggestions ??

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    set your taxonomy to be hierarchical to get the checkbox version you’re likely thinking of with the default categories. Should do the trick for ya.

    Thread Starter stijndemulder

    (@stijndemulder)

    OK, thanks, will give it a try.

    Any possibility for a radio button so they can only choose one?

    I was planning to replace them with ACF fields but metabox_cb issue wont let me…

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not without that metabox_cb or possibly some other completely unrelated plugin that can set up their own taxonomy stuff.

    Thread Starter stijndemulder

    (@stijndemulder)

    OK, thanks Michael.

    I did find a code snippet which I’ll try tomorrow.
    I’ll let you know if it works.

    Thread Starter stijndemulder

    (@stijndemulder)

    Used next snippet and this fixed it.
    I can set metabox_cb to false in CPT UI and it’s hidden in the new/edit post.

    https://github.com/WordPress/gutenberg/issues/13816#issuecomment-470137667

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Noted, and a good find for anyone coming across this thread.

    An alternative workaround to prevent the metabox showing in Gutenburg is setting Show in REST API to False.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Make sure you’re adding taxonomy term assignment methods via an alternative way, because removing the REST API support removes it completely from the editor screen via default ways from WP core.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Hide meta box in gutenberg’ is closed to new replies.