Custom Fields
Re-Envisioned
Support Meta Box Conditional Logic Conditional Logic Custom Taxonomy

This topic contains 6 replies, has 3 voices, and was last updated by  Max@powdersky.com 5 days, 16 hours ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #10182

    Max@powdersky.com
    Participant

    Hi,

    I have used this for a custom taxonomy but it doesn’t seem to be working, anything I am clearly doing wrong or anything I need to include?

            array(
               'name'  => 'Off Market Property?',
               'id'    => self::$prefix . 'off_market',
               'type'  => 'checkbox',
               'tab'  => 'general',
               'visible' => array( 'slug:tax_query[_property_destinations]', 'in', array(7,9) ),
             ),

    Thanks

    #10186

    meta_gecko
    Participant

    I came here to ask the same question. The conditional show/hide doesn’t seem to work on the taxonomy select fields, and checkboxes.

    #10254

    Max@powdersky.com
    Participant

    Sorry anyone have an answer to this as have a project that needs this implemented.

    #10274

    Anh Tran
    Keymaster

    Hi Max,

    Can you try:

    1 – Changing from number 7, 9 to string '7', '9'? Or
    2 – Using the term slugs instead of id?

    #10501

    Max@powdersky.com
    Participant

    Hi Anh,

    Sorry for the late reply I have been away the last 2 weeks. I have just tried both and no luck with either.

    Just to confirm this will show the field if in any of those categories?

    Thanks

    #10514

    Anh Tran
    Keymaster

    Yes, that’s what the condition says. However, I think the problem might be: the value of a taxonomy is always an array (as we can select multiple terms to assign to a post). So it’s not correct to says one array “in” another array. Can you try “contains” one value, and add another condition for the other value?

    #10553

    Max@powdersky.com
    Participant

    Nope unfortunately not:

           'visible' => array( 'slug:tax_query[_property_destinations]', 'contains', 'france' ),
    
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.