Multiple relations for meta box/field visibility

Support MB Conditional Logic Multiple relations for meta box/field visibilityResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19034
    wgstjfwgstjf
    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

    #19048
    Long NguyenLong 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
    wgstjfwgstjf
    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 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.