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>
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.