[wp-trac] [WordPress Trac] #18143: Add size for Gallery Settings
WordPress Trac
noreply at wordpress.org
Mon Sep 29 09:31:52 UTC 2014
#18143: Add size for Gallery Settings
-----------------------------------+---------------------
Reporter: designsimply | Owner: nacin
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.1
Component: Gallery | Version: 3.2.1
Severity: normal | Resolution: fixed
Keywords: westi-likes has-patch | Focuses:
-----------------------------------+---------------------
Comment (by Stagger Lee):
For all those who cannot wait here is nice snippet for functions.php:
{{{
function gallery_shortcode_change_default_size( $out, $pairs, $atts ) {
if ('1' == $atts['columns']) {
$out['size'] = 'gallery-thumbnail-l';
} elseif ('2' == $atts['columns']) {
$out['size'] = 'gallery-thumbnail-2';
} elseif ('3' == $atts['columns']) {
$out['size'] = 'gallery-thumbnail-3';
} elseif ('' == $atts['columns']) {
$out['size'] = 'gallery-thumbnail-3';
}
return $out;
}
add_filter( 'shortcode_atts_gallery',
'gallery_shortcode_change_default_size', 10, 3 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/18143#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list