Home › Forums › ACF PRO › Exclude taxonomy terms from frontend display › Reply To: Exclude taxonomy terms from frontend display
This is my filter function. Its not working. Here category is the custom field with taxonomy type and its called category. It is supposed to pull all categories from “product_cat”.
add_filter('acf/fields/taxonomy/wp_list_categories/name=category', 'exclude_taxonomy_args', 10, 2);
function exclude_taxonomy_args( $args, $field ) {
$args['exclude'] = array(19,27,28); //the IDs of the excluded terms
return $args;
}
After adding this, I still see the categories mentioned in the exclude above.
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.