Home › Forums › General Issues › Change the order in relationship picker › Reply To: Change the order in relationship picker
‘orderby’ is set by ACF after the acf/fields/relationship/query/ filter. The reason for this is that ACF groups the posts based on post type when posts can be selected from multiple post types. It also orders them by parent/child. There isn’t a filter in ACF that can be used to alter this.
To accomplish this you would have to add a pre_get_posts action inside of your filter that would be used by the query that ACF eventually runs. Altering the order at this point will break the relationship field display in some cases, especially when posts can be selected from more than one post type.
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.