get_children() displays drafts by default
|Reported by:||layotte||Owned by:|
Was working with get_children and noticed that it was displaying some draft pages. According to the current documentation (http://codex.wordpress.org/Function_Reference/get_children) the default is "any" for post status:
(string) Any value from the post_status column of the wp_posts table, such as publish, draft, or inherit; or the keyword any. Default: any
I believe it should act like get_posts --- the default should be "publish" for posts and "inherit" for attachments.
Attached is my diff with the fix...
basically I removed the $defaults setting of 'post_status' => 'any'... and I let get_posts handle the logic.
Change History (7)
- Keywords has_patch needs_testing added; has-patch get_children removed
- Keywords has-patch needs-testing added; has_patch needs_testing removed
- Keywords 2nd-opinion added; needs-testing removed
- Milestone changed from Awaiting Review to 3.1