Ticket #11725: 11725.4.patch
File 11725.4.patch, 2.1 KB (added by , 12 years ago) |
---|
-
wp-includes/media.php
802 802 'columns' => 3, 803 803 'size' => 'thumbnail', 804 804 'include' => '', 805 'exclude' => '' 805 'exclude' => '', 806 'start' => 1, 807 'count' => -1, 806 808 ), $attr)); 807 809 808 810 $id = intval($id); 811 $start = intval($start); 812 $count = intval($count); 809 813 if ( 'RAND' == $order ) 810 814 $orderby = 'none'; 811 815 812 816 if ( !empty($include) ) { 813 817 $include = preg_replace( '/[^0-9,]+/', '', $include ); 814 $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );818 $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) ); 815 819 816 820 $attachments = array(); 817 821 foreach ( $_attachments as $key => $val ) { … … 819 823 } 820 824 } elseif ( !empty($exclude) ) { 821 825 $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); 822 $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );826 $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) ); 823 827 } else { 824 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );828 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'offset' => $start-1, 'numberposts' => $count ) ); 825 829 } 826 830 827 831 if ( empty($attachments) )