Problem Showing if Multiple Categories Selected

Support MB Show Hide Problem Showing if Multiple Categories Selected

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4056
    metabox@makane.net[email protected]
    Participant

    Hi, I have a category "Product" with many sub-categories. If I use the code: 'show'=> array( 'category' => array( 'Product' )), -- and only have the Product category selected, the MetaBox shows up as it should. But if in the post I select another category or a sub-catagory, the MetaBox is hidden. Please let me know what I'm doing wrong! Thanks!

    #4060
    Tan NguyenTan Nguyen
    Participant

    Hi bro,

    Because you've purchased Developer Bundle. You can use MB Conditional Logic instead. It has more features for you:

    Instead of:

    
    'show' => ['category' => ['Product']]
    

    You can use:

    
    'visible' => ['slug:post_category', 'product']
    

    Documentation can be found here:
    https://metabox.io/docs/meta-box-conditional-logic/

    Best regards,

    Tan

    #4074
    metabox@makane.net[email protected]
    Participant

    Thanks for the help! Loving your plugins!

    #4077
    metabox@makane.net[email protected]
    Participant

    Hello Tan,
    Now I'm using 'visible' => ['slug:post_category', 'product'], and the metabox still only appears if I have just the single category "Product" selected. If I select any sub-categories or other categories it goes away. I want the metabox to always appear if the "Product" category is selected regardless of any other categories.
    Thanks,
    Matthew

    #4085
    Tan NguyenTan Nguyen
    Participant

    Got it, my suggestion syntax is for exactly match when post category should be product and cannot belongs to another one. If you want to show your meta box when post categories is in product and others. You can use in operator:

    
    'visible' => ['slug:post_category', 'in', ['product']],
    

    Best regards,

    Tan

    #4089
    metabox@makane.net[email protected]
    Participant

    Thanks again Tan! Now it's working perfectly.

    #4090
    Tan NguyenTan Nguyen
    Participant

    Dear Matt,

    Glad that it works. Please don't hesitate to tell us if you have another problems.

    Best regards,

    Tan

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Problem Showing if Multiple Categories Selected’ is closed to new replies.