Make WordPress Core

Opened 7 years ago

Last modified 11 months ago

#40650 new enhancement

get_pages() should accept 'any' among it's post_status arg

Reported by: pbiron's profile pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.4
Component: Posts, Post Types Keywords: has-patch needs-refresh
Focuses: Cc:


WP_Query::get_posts() accepts 'any' among it's $post_status $query_vars and I think get_pages() should do the same.

I've combed through the 4.7.4 core code and can't find any place where this enhancement would break existing code.

Attachments (1)

40650.diff (1.7 KB) - added by pbiron 7 years ago.

Download all attachments as: .zip

Change History (7)

7 years ago

#1 @pbiron
7 years ago

  • Keywords has-patch added

#2 @pbiron
7 years ago

FYI: The patch I've attached is loosely based on how 'any' is handled in WP_Query()::get_posts(), but since get_pages() is implemented very differently from WP_Query::get_posts() is kind of different.

#3 @pbiron
7 years ago

The note about me combing through the 4.7.4 core code is my signal that someone who knows the history of how get_pages() has been used in core in previous versions should check that my patch doesn't break previous versions of core if this patch would be backported.

#4 @pbiron
7 years ago

My immediate need for this request is a use of wp_dropdown_pages() on a post_type that uses custom post_stati and I was surprised to learn that I couldn't use 'any' to include posts with these custom post stati.

#5 @pbiron
7 years ago

  • Summary changed from get_pages() should accept 'any' among it's post_stautus arg to get_pages() should accept 'any' among it's post_status arg

#6 @spacedmonkey
11 months ago

  • Keywords needs-refresh added

@pbiron This patch will have to be refreshed now #12821 has been committed.

Note: See TracTickets for help on using tickets.