Make WordPress Core

Opened 11 years ago

Closed 8 years ago

Last modified 8 years ago

#35654 closed enhancement (duplicate)

Make Gallery size default configurable

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

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 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 11 years ago.
Gallery Settings Size pulldown

Download all attachments as: .zip

Change History (9)

@boblet
11 years ago

Gallery Settings Size pulldown

#1 @boblet
11 years ago

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

#2 @Stagger Lee
10 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 10 years ago by Stagger Lee (previous) (diff)

#3 @SergeyBiryukov
10 years ago

#36810 was marked as a duplicate.

#4 @programmin
10 years ago

Same in 4.5.3

#5 @joemcgill
10 years ago

  • Keywords needs-patch added

#6 @chrisvanpatten
9 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
8 years ago

  • Resolutionduplicate
  • Status newclosed

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

#8 @netweb
8 years ago

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