Ticket #21816: 21816.diff
File 21816.diff, 893 bytes (added by , 13 years ago) |
---|
-
wp-includes/media.php
function gallery_shortcode($attr) { 801 801 'captiontag' => 'dd', 802 802 'columns' => 3, 803 803 'size' => 'thumbnail', 804 'ids' => '', 804 805 'include' => '', 805 806 'exclude' => '' 806 807 ), $attr)); … … function gallery_shortcode($attr) { 809 810 if ( 'RAND' == $order ) 810 811 $orderby = 'none'; 811 812 813 if ( !empty( $ids ) ) { 814 // 'ids' is explicitly ordered 815 $orderby = 'post__in'; 816 $include = $ids; 817 } 818 812 819 if ( !empty($include) ) { 813 820 $include = preg_replace( '/[^0-9,]+/', '', $include ); 814 821 $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );