Home › Forums › Backend Issues (wp-admin) › Use product category for ACF conditions › Reply To: Use product category for ACF conditions
Hello, and thank you for the reply.
I’ve read your docs. But i still don’t understand how to proceed.
I basically need to add 3 options on the ‘type’ section, that are 3 product categories where i want there will be displayed only some ACF Groups.
For now, i’ve done something like that:
add_filter('acf/location/rule_values/post_category', 'acf_location_rules_values_user');
function acf_location_rules_values_user( $choices ) {
$my_filter_list = [0 => 'Books', 1 => 'Ebooks', 19091 => 'Reader'];
return $my_filter_list;
}
Before my array was 0,1,2. But i noticed that, even if i have the setting displayed on my backoffice, it’s totally not working. So i tried to change the ‘2’ with the product category ID. But is always not working.
What am i doing wrong? I maybe need to first put every category in the array?
Thank you in advance.
– Kryuko
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.