Ticket #6772: fix_get_children_get_posts.diff
| File fix_get_children_get_posts.diff, 2.0 kB (added by filosofo, 2 months ago) |
|---|
-
wp-includes/post.php
old new 408 408 'order' => 'DESC', 'include' => '', 409 409 'exclude' => '', 'meta_key' => '', 410 410 'meta_value' =>'', 'post_type' => 'post', 411 'post_ status' => 'publish', 'post_parent' => 0411 'post_parent' => 0 412 412 ); 413 413 414 414 $r = wp_parse_args( $args, $defaults ); 415 if ( empty( $r['post_status'] ) ) 416 $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish'; 415 417 if ( ! empty($r['numberposts']) ) 416 418 $r['posts_per_page'] = $r['numberposts']; 417 419 if ( ! empty($r['category']) ) -
wp-includes/media.php
old new 349 349 } 350 350 351 351 extract(shortcode_atts(array( 352 'orderby' => 'menu_order ASC, ID ASC', 352 'order' => 'ASC', 353 'orderby' => 'menu_order ID', 353 354 'id' => $post->ID, 354 355 'itemtag' => 'dl', 355 356 'icontag' => 'dt', … … 359 360 ), $attr)); 360 361 361 362 $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) ); 363 364 364 365 if ( empty($attachments) ) 365 366 return ''; … … 433 434 function adjacent_image_link($prev = true) { 434 435 global $post; 435 436 $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') )); 437 438 438 439 foreach ( $attachments as $k => $attachment ) 439 440 if ( $attachment->ID == $post->ID )
