[wp-trac] Re: [WordPress Trac] #6772: get_posts Should Use WP_Query

WordPress Trac wp-trac at lists.automattic.com
Mon May 5 06:40:30 GMT 2008


#6772: get_posts Should Use WP_Query
-----------------------------------------------+----------------------------
 Reporter:  filosofo                           |        Owner:  anonymous
     Type:  defect                             |       Status:  reopened 
 Priority:  normal                             |    Milestone:  2.6      
Component:  General                            |      Version:  2.6      
 Severity:  blocker                            |   Resolution:           
 Keywords:  wp_query get_posts wpdb has-patch  |  
-----------------------------------------------+----------------------------
Comment (by DD32):

 Replying to [comment:6 matt]:
 > With [7879] all my galleries work perfectly, with [7880] they disappear.

 Example Query created:
 {{{
 SELECT   wp_posts.* FROM wp_posts  WHERE 1=1 AND wp_posts.post_parent =
 137  AND (post_mime_type LIKE 'image/%')  AND wp_posts.post_type =
 'attachment'  AND (wp_posts.post_status = 'publish' OR
 wp_posts.post_author = 2 AND wp_posts.post_status = 'private') ORDER BY
 menu_order,wp_posts.ID DESC
 }}}

 Which fails for The Gallery as attachments have a post_status of 'inherit'

 I've attached a patch which causes the gallery to specifically set the
 post_status.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6772#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list