use_default_gallery_style boolean filter and new gallery-columns-* class. see #15103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
951549bf93
commit
96b5c58ec2
|
@ -823,7 +823,9 @@ function gallery_shortcode($attr) {
|
||||||
|
|
||||||
$selector = "gallery-{$instance}";
|
$selector = "gallery-{$instance}";
|
||||||
|
|
||||||
$output = apply_filters('gallery_style', "
|
$gallery_style = $gallery_div = '';
|
||||||
|
if ( apply_filters( 'use_default_gallery_style', true ) )
|
||||||
|
$gallery_style = "
|
||||||
<style type='text/css'>
|
<style type='text/css'>
|
||||||
#{$selector} {
|
#{$selector} {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
@ -832,7 +834,8 @@ function gallery_shortcode($attr) {
|
||||||
float: {$float};
|
float: {$float};
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: {$itemwidth}%; }
|
width: {$itemwidth}%;
|
||||||
|
}
|
||||||
#{$selector} img {
|
#{$selector} img {
|
||||||
border: 2px solid #cfcfcf;
|
border: 2px solid #cfcfcf;
|
||||||
}
|
}
|
||||||
|
@ -840,8 +843,10 @@ function gallery_shortcode($attr) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!-- see gallery_shortcode() in wp-includes/media.php -->
|
<!-- see gallery_shortcode() in wp-includes/media.php -->";
|
||||||
<div id='$selector' class='gallery galleryid-{$id}'>");
|
$size_class = sanitize_html_class( $size );
|
||||||
|
$gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
|
||||||
|
$output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ( $attachments as $id => $attachment ) {
|
foreach ( $attachments as $id => $attachment ) {
|
||||||
|
|
Loading…
Reference in New Issue