Ticket #22617: 22617.diff
| File 22617.diff, 1.1 KB (added by nacin, 6 months ago) |
|---|
-
wp-includes/media.php
669 669 static $instance = 0; 670 670 $instance++; 671 671 672 if ( ! empty( $attr['ids'] ) ) { 673 // 'ids' is explicitly ordered 674 $attr['orderby'] = 'post__in'; 675 $attr['include'] = $attr['ids']; 676 } 677 672 678 // Allow plugins/themes to override the default gallery template. 673 679 $output = apply_filters('post_gallery', '', $attr); 674 680 if ( $output != '' ) … … 690 696 'captiontag' => 'dd', 691 697 'columns' => 3, 692 698 'size' => 'thumbnail', 693 'ids' => '',694 699 'include' => '', 695 700 'exclude' => '' 696 701 ), $attr)); … … 699 704 if ( 'RAND' == $order ) 700 705 $orderby = 'none'; 701 706 702 if ( !empty( $ids ) ) {703 // 'ids' is explicitly ordered704 $orderby = 'post__in';705 $include = $ids;706 }707 708 707 if ( !empty($include) ) { 709 708 $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); 710 709
