Support

Account

Home Forums Backend Issues (wp-admin) A filter for taxonomy field Reply To: A filter for taxonomy field

  • Hi @wpuxsolutions

    Looking at the taxonomy field type file, on line 205 you will see this line of code:

    
    // vars
    		$args = array(
    			'taxonomy'     => $field['taxonomy'],
    			'hide_empty'   => false,
    			'style'        => 'none',
    			'walker'       => new acf_taxonomy_field_walker( $field ),
    		);
    		
    		$args = apply_filters('acf/fields/taxonomy/wp_list_categories', $args, $field );
    

    Using this filter, you can customize the $args. These $args are later used on line 238 in the function wp_list_categories. If you check out this function on WordPress, you will see that there are some params which ‘exclude’.

    Thanks
    E