#35654 closed enhancement (duplicate)
Make Gallery size default configurable
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4 |
Component: | Gallery | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Currently it’s not possible to set the default size in the Gallery Sizes pulldown when adding a gallery—it’s always thumbnail
.
Size pulldown(http://oli.jp/temp/2016-01-29-wp4.4-gallery-size-setting.png)?
For example, this code will set columns
but not size
function my_gallery_defaults( $settings ) { $settings['galleryDefaults']['columns'] = 2; $settings['galleryDefaults']['size'] = 'medium'; return $settings; } add_filter( 'media_view_settings', 'my_gallery_defaults' );
This has been mentioned in previous tickets:
- #18143 Adds Sizes pulldown to UI (but no
$settings['galleryDefaults']['size']
) - #27515 Request for
$settings['galleryDefaults']['size']
but marked as dupe of #18143 - #28693 Adds
$settings['galleryDefaults']
support forcolumns
andlink
- #29032 Request for setting a custom default gallery size but marked as dupe of #18143
While this can be overridden via the UI, it would be nice to set the initial Gallery default size for a theme.
Attachments (1)
Change History (9)
#2
@
9 years ago
It works well. It inserts attribute inside shortcode, your image size from filter is used. Just this JS code responsible for select dropdown switch cannot work with this filter.
Image sizes miss "galleryDefaults" if I remember right.
#6
@
8 years ago
#40692 was posted a few weeks back, and although it is a duplicate of this ticket it does have a working patch.
Gallery Settings Size pulldown