Ticket #21082: 21082.2.diff
File 21082.2.diff, 1.7 KB (added by , 11 years ago) |
---|
-
wp-includes/media.php
748 748 $itemwidth = $columns > 0 ? floor(100/$columns) : 100; 749 749 $float = is_rtl() ? 'right' : 'left'; 750 750 751 $selector = "gallery-{$i nstance}";751 $selector = "gallery-{$id}-{$instance}"; 752 752 753 753 $gallery_style = $gallery_div = ''; 754 if ( apply_filters( 'use_default_gallery_style', true ) ) 754 755 if ( apply_filters( 'use_default_gallery_style', true ) ) { 756 755 757 $gallery_style = " 756 758 <style type='text/css'> 757 #{$selector} { 759 #{$selector} .gallery-item { 760 width: {$itemwidth}%; 761 } 762 </style> 763 <!-- see gallery_shortcode() in wp-includes/media.php -->"; 764 765 //check if this is the first instance and add general styles 766 if( 1 == $instance ) { 767 $general_gallery_style = " 768 <style type='text/css'> 769 .gallery { 758 770 margin: auto; 759 771 } 760 #{$selector}.gallery-item {772 .gallery .gallery-item { 761 773 float: {$float}; 762 774 margin-top: 10px; 763 775 text-align: center; 764 width: {$itemwidth}%;765 776 } 766 #{$selector}img {777 .gallery img { 767 778 border: 2px solid #cfcfcf; 768 779 } 769 #{$selector}.gallery-caption {780 .gallery .gallery-caption { 770 781 margin-left: 0; 771 782 } 772 </style> 773 <!-- see gallery_shortcode() in wp-includes/media.php -->"; 783 </style>"; 784 $gallery_style .= $general_gallery_style; 785 } 786 } 787 774 788 $size_class = sanitize_html_class( $size ); 775 789 $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>"; 776 790 $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );