• Resolved MM_wp

    (@mm_wp)


    Hello,
    if I select
    “hierarchical” = false,
    “show_in_quick_edit” = true,
    “meta_box_cb” = “post_categories_meta_box”
    the “Quick Edit” part won’t work because it tries to validate the input as a checkbox resulting in a PHP error.
    Since those are all values that are available in the “UI” options given I think there should be a control to avoid this in the plugin or update the option “meta_box_cb” description accordingly.

    • This topic was modified 4 years, 9 months ago by MM_wp. Reason: missing word
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just out of curiosity and to be certain, before I request an export of your taxonomy settings so I can try to recreate, can you try without setting the meta_box_cb and see if it works afterwards?

    That said, I’m curious why you’re trying to pass a categories based callback function name for a non-hierarchical taxonomy. Those taxonomy types are equivalent to the post tags, where you just type in the terms to associate.

    Regarding any attempts to prevent, that is feeling fairly open ended and difficult to prevent since pretty much anything could be passed in for the callback name, and we’d have zero way to know what is being done with it, for what purposes, etc.

    Thread Starter MM_wp

    (@mm_wp)

    1. Without the meta_box_cb it all works as expected
    2. I added that setting because it was better for me to have the list of checkbox to select rather than the “type in” metabox. It works without problems in the edit page, but breaks in the quick edit where the “type in” is showed and obv fails the validation.
    3. To prevent: IMO a notice that says “non-hierarchical taxonomies can’t be used in Quick Edit with post_categories_meta_box callback” would be nice.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    If you set the taxonomy to be hierarchical, you’ll get the checkbox version by default without having to set custom metabox callbacks and it’d work just fine in quick edit. Any specific reasons you need it to be non-hierarchical? Or is that just an unrealized detail?

    Can’t say I have seen a bunch of people trying to pass the callback for non-hierarchical taxonomies, so I’m not too high on the idea of adding that specific of a note to the admin UI.

    Thread Starter MM_wp

    (@mm_wp)

    Whatever man, thanks for the replies and have a nice day.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Can’t save non-hierarchical taxonomies with checkbox Metabox in “Quick Edit”’ is closed to new replies.