Taxonomy Advanced field - How to filter the taxonomies that we can select

Support General Taxonomy Advanced field - How to filter the taxonomies that we can select

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39218
    AdrienAdrien
    Participant

    Hello,

    I have a taxonomy advanced field, here's the setting: https://markuphero.com/share/P1Cd2UmJFmQs1A6Iv3yM
    I have nothing changed in the "Advanced" tab.

    I would like to know how I can filter the taxonomy that we can select inside this field but based on which taxonomy field is selected with the default connection with Metabox CPT <-> Custom taxonomy.
    Here's the screenshot to demonstrate what I would want to achieve: https://markuphero.com/share/eGOLdgCoJzR9S0E71wFP

    My use case is that I need a "Primary" taxonomy for this CPT, and it's not possible by default.
    So I want to let my client use this field, so he can choose which custom taxonomy would be the primary one.

    #39229
    PeterPeter
    Moderator

    Hello Adrien,

    As I understand, you want to display terms in the selection of the taxonomy_advanced based on the selected term in the default custom taxonomy box of Meta Box. It is not possible with the field taxonomy_advanced.

    I think you can use the field select instead of the field taxonomy_advanced. You can create a custom PHP callback function that returns options for the select field from the selected term. But the options will display on loading, it will not display immediately after selecting the term in the default custom taxonomy box.

    Here is an example to create a custom callback function https://support.metabox.io/topic/callbacks-for-the-controls-with-choices/

    #39235
    AdrienAdrien
    Participant

    Hello Peter,

    That's interesting, I'll try it.
    Aside I used Taxonomy Advanced with radio list and ajax false and then on page load with JavaScript I removed all the options that I didn't have in my default custom taxonomy box.
    And I made the field required, that's working for now, but I'll try with the Select method.
    I would prefer to have the right field on load and not rely on JavaScript.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.