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 ?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
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( arrray( 'post_status' => array( 'future', 'publish' ), ) );