Ticket #11725: media.patch
| File media.patch, 1.2 KB (added by frymi, 3 years ago) |
|---|
-
media.php
695 695 'columns' => 3, 696 696 'size' => 'thumbnail', 697 697 'include' => '', 698 'exclude' => '' 698 'exclude' => '', 699 'count' => 'all', 700 'start' => '1' 699 701 ), $attr)); 700 702 701 703 $id = intval($id); … … 755 757 <!-- see gallery_shortcode() in wp-includes/media.php --> 756 758 <div id='$selector' class='gallery galleryid-{$id}'>"); 757 759 760 $gallery_count = 0; 761 $count_all = count( $attachments ); 762 if ( !$start || $start < 1 || $start > $count_all ) 763 $start = 1; 764 else 765 $start = absint( $start ); 766 if ( !$count || $count < 1 || $count > $count_all || $count == "all" ) 767 $start_last = $count_all; 768 else 769 $start_last = $start + absint( $count ) - 1; 770 758 771 $i = 0; 759 772 foreach ( $attachments as $id => $attachment ) { 773 774 $gallery_count++; 775 if ( $gallery_count < $start || $gallery_count > $start_last ) 776 continue; 777 760 778 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 761 779 762 780 $output .= "<{$itemtag} class='gallery-item'>";
