[wp-trac] Re: [WordPress Trac] #8603: post_parent default in get_children

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 14 10:32:32 GMT 2008


#8603: post_parent default in get_children
---------------------+------------------------------------------------------
 Reporter:  jdub     |        Owner:  anonymous
     Type:  defect   |       Status:  new      
 Priority:  normal   |    Milestone:  2.7.1    
Component:  General  |      Version:  2.7      
 Severity:  normal   |   Resolution:           
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by Viper007Bond):

 I ended up using this:

 {{{
 $attachments =& get_children( array(
                         'post_type' => 'attachment',
                         'post_mime_type' => 'image',
                         'numberposts' => -1,
                         'post_status' => null,
                         'post_parent' => null, // any parent
                         'output' => 'object',
                 ) );
 }}}

 I think we should default to `null` rather than `0` to maintain backward
 compatibility.

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


More information about the wp-trac mailing list