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)

  • I’m on a dead-end here. I noticed from another coding issue that I should define the variables written in the function ($args, $field, $post_id). Post ID is clear what to do with it, but I’m not sure if and with what I should define $args and $fields. I have no idea what $fields relates to at all.

    $post_id = get_the_ID();
    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 );