Ticket #11725: 11725.3.diff
File 11725.3.diff, 2.3 KB (added by , 13 years ago) |
---|
-
wp-includes/media.php
783 783 'columns' => 3, 784 784 'size' => 'thumbnail', 785 785 'include' => '', 786 'exclude' => '' 786 'exclude' => '', 787 'start' => 1, 788 'count' => -1, 787 789 ), $attr)); 788 790 789 791 $id = intval($id); … … 792 794 793 795 if ( !empty($include) ) { 794 796 $include = preg_replace( '/[^0-9,]+/', '', $include ); 795 $_attachments = get_posts( array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );797 $_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 ) ); 796 798 797 799 $attachments = array(); 798 800 foreach ( $_attachments as $key => $val ) { … … 800 802 } 801 803 } elseif ( !empty($exclude) ) { 802 804 $exclude = preg_replace( '/[^0-9,]+/', '', $exclude ); 803 $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );805 $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 ) ); 804 806 } else { 805 $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );807 $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 ) ); 806 808 } 807 809 808 810 if ( empty($attachments) ) … … 1398 1400 require_once( ABSPATH . WPINC . '/class-oembed.php' ); 1399 1401 $oembed = _wp_oembed_get_object(); 1400 1402 $oembed->providers[$format] = array( $provider, $regex ); 1401 } 1402 No newline at end of file 1403 }