Home › Forums › Backend Issues (wp-admin) › Sorting multiple taxonomies in backend issue › Reply To: Sorting multiple taxonomies in backend issue
If I understand you correctly, it looks like you are trying to get the choices in the post object to display in alphabetical order.
Have you tried the following:
function my_post_object_query( $args, $field, $post_id ) {
// modify args
$args['orderby'] = 'title'; //title of the post
$args['order'] = 'ASC'; //order a-z; use DESC for z-a
// return
return $args;
}
add_filter('acf/fields/post_object/query/key={field key}', 'my_post_object_query', 10, 3);
Change the field key to the field key for your post object (it should look like this: acf/fields/post_object/query/key=field_508a263b40457 . Then add the code to your functions.php file
Documentation Hier
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.