Home › Forums › ACF PRO › Choose wordpress tags shown in ACF field taxonomy (= do not show every term) › Reply To: Choose wordpress tags shown in ACF field taxonomy (= do not show every term)
Not really sure what I can still change to make it work. For now, I have the following in my theme’s functions.php:
function my_taxonomy_query( $args, $field, $post_id ) {
// modify args
$args['orderby'] = 'count';
$args['order'] = 'ASC';
$args['include'] = '589,186'; // list of terms to include
// return
return $args;
}
add_filter('acf/fields/taxonomy/query/name=ti_tag_test', 'my_taxonomy_query', 10, 3 );
As far as I understand, the args value alters the get_terms function. I already defined which acf field I like to alter (add_filter, last row) and which tags to include with $args[‘include’]. It still shows all the tag terms though.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.