WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/05/2008 03:46:32 PM (14 years ago)
Author:
ryan
Message:

get_posts fixes from DD32 and filosofo. see #6772

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r7838 r7892  
    350350
    351351    extract(shortcode_atts(array(
    352         'orderby'    => 'menu_order ASC, ID ASC',
     352        'order'      => 'ASC',
     353        'orderby'    => 'menu_order ID',
    353354        'id'         => $post->ID,
    354355        'itemtag'    => 'dl',
     
    360361
    361362    $id = intval($id);
    362     $attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}");
     363    $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
    363364
    364365    if ( empty($attachments) )
     
    434435    global $post;
    435436    $post = get_post($post);
    436     $attachments = array_values(get_children("post_parent=$post->post_parent&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC"));
     437    $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ));
    437438
    438439    foreach ( $attachments as $k => $attachment )
Note: See TracChangeset for help on using the changeset viewer.