Sort users list (admin area) by ACF post object/relationship title (not by ID)

Question

I have custom fields for users for example "City".

And "City" is a custom post type and in ACF it’s using for users as a Relationship/Post object.
And if in Users page sort by City it sorting by cities IDs in usersmeta.

How to sort users by "City" name? not by id.

What hook or filter need to use? pre_user_query and how it will look.

0
user2481034 2 months 0 Answers 7 views 0

Leave an answer