Support Forum
Support › Meta Box Conditional Logic › MetaBox doesn't saves and it doesn't work with selected category › Reply To: MetaBox doesn't saves and it doesn't work with selected category
Hi,
There are several things in this case:
The value for the category select actually is the category ID, so we have to use IDs instead of category slug or name.
The category select has a field type checkbox_tree
, which means its value is an array. We can't use operator =
in this case. Instead, use contains
.
I have adapted your code and made a fix here (please change the categories' IDs to match your case):
Here is my test: