Home › Forums › Feature Requests › Change the order of post types in Post Object field dropdown/search input › Reply To: Change the order of post types in Post Object field dropdown/search input
Short story: This isn’t possible.
Long story:
ACF uses get_post_types() https://codex.wordpress.org/Function_Reference/get_post_types to get the list of available post types.
This function does not have any arguments to specify how they should be ordered. Basically WP just returns the contents of the global variable $wp_post_types
filtered to only show specific post types based on other arguments. The global value is an array of post types in the order that they are created.
I did some digging in WP and there isn’t any way to filter this that I can find.
Even when selecting the post types when creating the field, the same thing is done.
Possible Hack:
At some point before ACF accesses the post types, access the WP global variable and reorder the array of post types to the order you want them returned.
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.