• Resolved Pk

    (@paulka)


    The last option in the edit Taxonomy section is:

    Metabox callback

    I’ve added the following to the box: post_categories_meta_box

    But it doesn’t change the way the box is displayed. I want it to show checkboxes, even though it isn’t Hierarchical.

    Should I use something else?

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

    (@tw2113)

    The BenchPresser

    Unsure as I’ve never tried going that route. For what it’s worth, you don’t NEED to create child terms, even if it’s possible you could. So to get checkbox selection options, I’d just end up making it hierarchical anyway.

    Beyond that, I’d need to peak inside that function mentioned above to see if it has any guard statements that are somehow preventing it from working in this example case.

    Thread Starter Pk

    (@paulka)

    Thanks for the speedy reply!

    I don’t quite understand though, the instructions underneath the field say “Sets a callback function name for the meta box display. Hierarchical default: post_categories_meta_box, non-hierarchical default: post_tags_meta_box. To remove the metabox completely, use “false”.”

    Am I using it incorrectly?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re providing a value correctly. I originally had a longer reply typed up for this, but you had me intrigued and I went digging. I also remembered some details.

    meta_box_cb, by my understanding, is completely ignored by Gutenberg.

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

    If you go with classic editor, providing the same custom cb showed the non-hierarchical terms as checkboxes for me. However, I don’t know how dedicated you may be to Gutenberg.

    Thread Starter Pk

    (@paulka)

    Ah fantastic!

    Not attached to Gutenberg for this project at all. Will revert.

    Thanks so much!

    • This reply was modified 5 years, 3 months ago by Pk.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing taxonomy metabox’ is closed to new replies.