I would like to create a dropdown of all schedule and publish CPT posts.

I seems function wp_dropdown_pages only displays list of publish posts, is it possible to choose which post states to display ?



If you look at the source for the function, you can see that the arguments to the function are passed directly through to get_pages(). That function supports a post_status argument that can be an array of statuses. So to do what you want all you need to do is pass the post statuses you want into a post_status argument of wp_dropdown_pages():

wp_dropdown_pages( arrray(
    'post_status' => array( 'future', 'publish' ),
) );
  • 1
    ps: I added a ticket #43355 to improve the inline documentation for wp_dropdown_pages(). – birgire Feb 19 '18 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.