Opened 17 years ago
Closed 17 years ago
#11123 closed defect (bug) (fixed)
Limit wp_get_recent_posts() to real/live posts
| Reported by: | josephscott | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Trash | Version: | 2.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The WP function wp_get_recent_posts does a simple SELECT against the posts table to get data on recent posts. This function is currently only used by the mw_getRecentPosts() function (XML-RPC method metaWeblog.getRecentPosts) to provide clients with a list of recent WP posts.
A check for post_status needs to be added so that wp_get_recent_posts only returns data for "real" posts, ones with a post_status of 'draft', 'publish', 'future', 'pending', or 'private'.
With out this metaWeblog.getRecentPosts will return data for posts that have been deleted when trash is turned on.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [12237]) Limit wp_get_recent_posts() to real/live posts, props josephscott, fixes #11123