Support

Account

Home Forums Backend Issues (wp-admin) How to put selected Taxonomy checkboxes at top of list? Reply To: How to put selected Taxonomy checkboxes at top of list?

  • ACF uses the built in wp_list_categories() function to show terms as checkboxes. I don’t know if you can alter the arguments for this function to do what you want. Here is the code from ACF

    
    		
    		// vars
    		$args = array(
    			'taxonomy'     		=> $field['taxonomy'],
    			'show_option_none'	=> sprintf( _x('No %s', 'No terms', 'acf'), strtolower($taxonomy_obj->labels->name) ),
    			'hide_empty'   		=> false,
    			'style'        		=> 'none',
    			'walker'       		=> new ACF_Taxonomy_Field_Walker( $field ),
    		);
    		
    		
    		// filter for 3rd party customization
    		$args = apply_filters('acf/fields/taxonomy/wp_list_categories', $args, $field);
    		$args = apply_filters('acf/fields/taxonomy/wp_list_categories/name=' . $field['_name'], $args, $field);
    		$args = apply_filters('acf/fields/taxonomy/wp_list_categories/key=' . $field['key'], $args, $field);
    		
    		?>
    <div class="categorychecklist-holder">
    	<ul class="acf-checkbox-list acf-bl">
    		<?php wp_list_categories( $args ); ?>
    	</ul>
    </div>