Home › Forums › Backend Issues (wp-admin) › Sorting a column for a user field › Reply To: Sorting a column for a user field
To be honest, I don’t think it’s possible to sort posts by a user field unless you want to sort them by user ID. My suggestion would be to create an acf/save_post filter https://www.advancedcustomfields.com/resources/acfsave_post/. In this filter get the user from the ACF field and create a value in a separate custom field using a standard WP update_post_meta() call an add the value you want to sort by to this other field. Then you’d be able to use this field in your query for ordering the posts.
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.