Ticket #10734: media.diff
File media.diff, 1.6 KB (added by , 15 years ago) |
---|
-
wp-includes/media.php
709 709 $itemtag = tag_escape($itemtag); 710 710 $captiontag = tag_escape($captiontag); 711 711 $columns = intval($columns); 712 $itemwidth = $columns > 0 ? floor(100/$columns) : 100;713 712 714 713 $selector = "gallery-{$instance}"; 715 714 716 715 $output = apply_filters('gallery_style', " 717 <style type='text/css'>718 #{$selector} {719 margin: auto;720 }721 #{$selector} .gallery-item {722 float: left;723 margin-top: 10px;724 text-align: center;725 width: {$itemwidth}%; }726 #{$selector} img {727 border: 2px solid #cfcfcf;728 }729 #{$selector} .gallery-caption {730 margin-left: 0;731 }732 </style>733 <!-- see gallery_shortcode() in wp-includes/media.php -->734 716 <div id='$selector' class='gallery galleryid-{$id}'>"); 735 717 736 718 $i = 0; 737 719 foreach ( $attachments as $id => $attachment ) { 738 720 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false); 739 721 740 $output .= "<{$itemtag} class='gallery-item '>";722 $output .= "<{$itemtag} class='gallery-item col-{$columns}'>"; 741 723 $output .= " 742 724 <{$icontag} class='gallery-icon'> 743 725 $link … … 750 732 } 751 733 $output .= "</{$itemtag}>"; 752 734 if ( $columns > 0 && ++$i % $columns == 0 ) 753 $output .= '<br style="clear: both"/>';735 $output .= '<br />'; 754 736 } 755 737 756 $output .= " 757 <br style='clear: both;' /> 758 </div>\n"; 738 $output .= "</div>\n"; 759 739 760 740 return $output; 761 741 }