Support

Account

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.