Display in Custom Post Type

Support MB Conditional Logic Display in Custom Post Type

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

    Hi Yan,
    'visible' => ['slug:post_category', 'in', ['product']] worked perfectly for displaying when a category was selected, but now I'm trying to show my metabox in a custom post type, also called product. I tried 'visible' => ['slug:post_type', 'product'] -- but that didn't work. Please help! Thanks!

    #4099
    Tan NguyenTan Nguyen
    Participant

    Dear Matt,

    Because post_category returns ids of categories, to cast it to array of slugs, we have to use slug: prefix.

    post_type returns string of current post type so we don't have to cast it. So just use:

    
    'visible' => ['post_type', 'product']
    

    Best regards,

    Tan

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Display in Custom Post Type’ is closed to new replies.