Ticket #11725: 11725.diff
File 11725.diff, 1.3 KB (added by , 15 years ago) |
---|
-
media.php
695 695 'columns' => 3, 696 696 'size' => 'thumbnail', 697 697 'include' => '', 698 'exclude' => '' 698 'exclude' => '', 699 'start' => '1', 700 'count' => 'all', 699 701 ), $attr)); 700 702 701 703 $id = intval($id); … … 720 722 if ( empty($attachments) ) 721 723 return ''; 722 724 725 $num_attachments = count( $attachments ); 726 $start = absint( $start ); 727 728 if ( $start > $num_attachments ) 729 return ''; 730 731 if ( 'all' != $count ) 732 $count = absint( $count ); 733 else 734 $count = $num_attachments; 735 723 736 if ( is_feed() ) { 724 737 $output = "\n"; 725 738 foreach ( $attachments as $att_id => $attachment ) … … 755 768 <!-- see gallery_shortcode() in wp-includes/media.php --> 756 769 <div id='$selector' class='gallery galleryid-{$id}'>"); 757 770 758 $i = 0; 771 $i = 0; $counter = 0; 759 772 foreach ( $attachments as $id => $attachment ) { 773 $counter++; 774 if ( $counter < $start ) 775 continue; 776 if ( $counter > ( $start + $count ) ) 777 break; 778 760 779 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 761 780 762 781 $output .= "<{$itemtag} class='gallery-item'>";