[wp-trac] [WordPress Trac] #11123: Limit wp_get_recent_posts() to real/live posts

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 11 23:09:33 UTC 2009


#11123: Limit wp_get_recent_posts() to real/live posts
--------------------------+-------------------------------------------------
 Reporter:  josephscott   |       Owner:           
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.9      
Component:  General       |     Version:  2.9      
 Severity:  normal        |    Keywords:  has-patch
--------------------------+-------------------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11123>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list