Ticket #6647: 6647.diff
File 6647.diff, 2.6 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/media.php
586 586 if ( $post && $post->post_type == 'attachment' ) 587 587 $attachments = array($post->ID => $post); 588 588 else 589 $attachments = get_children( "post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC");589 $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') ); 590 590 } else { 591 591 if ( is_array($GLOBALS['wp_the_query']->posts) ) 592 592 foreach ( $GLOBALS['wp_the_query']->posts as $attachment ) -
wp-includes/media.php
359 359 ), $attr)); 360 360 361 361 $id = intval($id); 362 $attachments = get_children( "post_parent=$id&post_type=attachment&post_mime_type=image&orderby={$orderby}");362 $attachments = get_children( array('post_parent'=> $id, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => $orderby) ); 363 363 364 364 if ( empty($attachments) ) 365 365 return ''; … … 433 433 function adjacent_image_link($prev = true) { 434 434 global $post; 435 435 $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"));436 $attachments = array_values( get_children( array('post_parent' => $post->post_parent, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order ASC, ID ASC') ) ); 437 437 438 438 foreach ( $attachments as $k => $attachment ) 439 439 if ( $attachment->ID == $post->ID ) -
wp-includes/post.php
70 70 function &get_children($args = '', $output = OBJECT) { 71 71 if ( empty( $args ) ) { 72 72 if ( isset( $GLOBALS['post'] ) ) { 73 $args = 'post_parent=' . (int) $GLOBALS['post']->post_parent;73 $args = array('post_parent' => (int) $GLOBALS['post']->post_parent ); 74 74 } else { 75 75 return false; 76 76 } 77 77 } elseif ( is_object( $args ) ) { 78 $args = 'post_parent=' . (int) $args->post_parent;78 $args = array('post_parent' => (int) $args->post_parent ); 79 79 } elseif ( is_numeric( $args ) ) { 80 $args = 'post_parent=' . (int) $args;80 $args = array('post_parent' => (int) $args); 81 81 } 82 82 83 83 $defaults = array(