Support

Account

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.