Make WordPress Core

Opened 8 years ago

Closed 5 years ago

Last modified 5 years ago

#35654 closed enhancement (duplicate)

Make Gallery size default configurable

Reported by: boblet's profile boblet Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Gallery Keywords: needs-patch
Focuses: Cc:


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(

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 for columns and link
  • #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)

2016-01-29-wp4.4-gallery-size-setting.png (5.6 KB) - added by boblet 8 years ago.
Gallery Settings Size pulldown

Download all attachments as: .zip

Change History (9)

8 years ago

Gallery Settings Size pulldown

#1 @boblet
8 years ago

I just tested version 4.3.1, and see the same behavior there. HTH!

#2 @Stagger Lee
8 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.

Last edited 8 years ago by Stagger Lee (previous) (diff)

#3 @SergeyBiryukov
8 years ago

#36810 was marked as a duplicate.

#4 @programmin
7 years ago

Same in 4.5.3

#5 @joemcgill
7 years ago

  • Keywords needs-patch added

#6 @chrisvanpatten
6 years ago

#40692 was posted a few weeks back, and although it is a duplicate of this ticket it does have a working patch.

#7 @cezariuszmarek
5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

I'm marking this as a duplicate of #40692, since the latter has a working patch.

#8 @netweb
5 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.