get_pages and get_posts do not work well with private posts
|Reported by:||Otto42||Owned by:|
The get_pages function has no way to retrieve private pages.
The get_posts function uses a post_status parameter, meaning that it can retrieve (and potentially display) private posts regardless of the user.
While get_pages() simply lacks a feature, I would argue that get_posts() is defective in that it can display things that it should not be able to display.
Both of these functions need to be updated to use the get_private_posts_cap_sql() function for building the correct post_status query segment.
Change History (20)
- Milestone changed from 2.5 to 2.6
- Type changed from defect to enhancement
- Keywords needs-patch added; has-patch needs-testing removed
- Milestone changed from 2.9 to Future Release
- Priority changed from normal to low
- Severity changed from major to minor
comment:12 in reply to: ↑ 2 Otto42 — 4 years ago
- Priority changed from low to normal
- Severity changed from minor to normal
- Type changed from enhancement to defect (bug)
- Version changed from 2.5 to 2.9.1