Custom Fields
Re-Envisioned
Support Meta Box Conditional Logic Multiple relations for meta box/field visibility

  • Creator
    Topic
  • #19034
    Resolved wgstjf
    Participant

    Hi, I hope you’re well.

    I’m trying to figure out how to have multiple relations when setting up the visibility for a field/meta box. The idea being it should be visible if any of a number of conditions are met AND some other condition is met.

    Something like this:

    
    'visible' => [
        [
            'when' => [
                ['page_template', 'in', ['default','page_templates/template-homepage.php']],
                ['post_type', 'in', ['capability','sector']],
                ],
            'relation' => 'or'
        ],
        [
            'when' => [
                ['capability_layout', '!=', 'alt'],
            ],
            'relation' => 'and'
        ],
    ],
    

    How can I acheive this?

    Cheers,

    Will

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #19048
    Long Nguyen
    Moderator

    Hi,

    Thank you for getting in touch with us.

    Currently, the extension only supports to create a single relation as the documentation. Thanks for the idea, we will research and develop this feature in the next time.

    Have a nice day.

    #19055
    wgstjf
    Participant

    Thanks Long, that’s great. I hope you can fit this in asap so that we can use it on our current client project.

    Cheers,

    Will

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash