Home › Forums › General Issues › User Field Order › Reply To: User Field Order
Hi @nickfmc
Just wanted to let you know I have pushed an update to github containing a filter for the user field $args.
You can hook in and modify them like so:
<?php
function my_acf_user_query( $args, $field, $post_id ) {
// http://codex.wordpress.org/Function_Reference/get_users
$args['orderby'] = 'nicename';
return $args;
}
add_filter('acf/fields/user/query/name=CUSTOM_FIELD_NAME', 'my_acf_user_query', 10, 3 );
?>
You can also remove the /name=CUSTOM_FIELD_NAME
for this to run on all user fields.
Thanks
E
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.