Ticket #26623: media(2).php.patch
| File media(2).php.patch, 2.5 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/media.php
735 735 'size' => 'thumbnail', 736 736 'include' => '', 737 737 'exclude' => '', 738 'link' => '' 738 'link' => '', 739 'class' => '' 739 740 ), $attr, 'gallery')); 740 741 741 742 $id = intval($id); … … 804 805 /* see gallery_shortcode() in wp-includes/media.php */ 805 806 </style>"; 806 807 $size_class = sanitize_html_class( $size ); 807 $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";808 $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );809 808 809 //allow plugins or themes to alter the gallery class 810 $gallery_class = apply_filters( 'gallery_class', "gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class} {$class}", $selector, $attr ); 811 812 //allow plugins or themes to alter the gallery container's opening markup. E.g. include extra attributes or even use a different tag 813 $gallery_start = apply_filters( 'gallery_container_start', "<div id='$selector' class='$gallery_class'>", $selector, $gallery_class, $attr ); 814 815 //allow plugins or themes to alter the default gallery inline styles 816 $gallery_style = apply_filters( 'gallery_style', $gallery_style, $selector, $attr ); 817 818 //allow plugins or themes to alter the gallery column separator markup 819 $gallery_separator = apply_filters( 'gallery_column_separator', '<br style="clear: both" />', $selector, $attr ); 820 821 //allow plugins or themes to alter the gallery container's closing markup 822 $gallery_end = apply_filters( 'gallery_container_end', " 823 <br style='clear: both;' /> 824 </div>\n", $selector, $attr ); 825 826 $output = $gallery_style . "\n\t\t" . $gallery_start; 827 810 828 $i = 0; 811 829 foreach ( $attachments as $id => $attachment ) { 812 830 if ( ! empty( $link ) && 'file' === $link ) … … 816 834 else 817 835 $image_output = wp_get_attachment_link( $id, $size, true, false ); 818 836 837 $image_output = apply_filters('gallery_image_output', $image_output, $id, $size ); 819 838 $image_meta = wp_get_attachment_metadata( $id ); 820 839 821 840 $orientation = ''; … … 835 854 } 836 855 $output .= "</{$itemtag}>"; 837 856 if ( $columns > 0 && ++$i % $columns == 0 ) 838 $output .= '<br style="clear: both" />';857 $output .= $gallery_separator; 839 858 } 840 859 841 $output .= " 842 <br style='clear: both;' /> 843 </div>\n"; 860 $output .= $gallery_end; 844 861 845 862 return $output; 846 863 }