WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#29032 closed feature request (duplicate)

Make gallery images size customizable in the editor

Reported by: GregLone Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.2
Component: Gallery Keywords: has-patch
Focuses: javascript Cc:
PR Number:

Description (last modified by SergeyBiryukov)

Hello.

Now the default parameters for the galleries can be customized (see #28693), it's not really difficult to allow the images size to be overridden.
The only thing we need to do then is to add our custom size with the "available ones":

add_filter( 'image_size_names_choose', 'custom_image_size_names_choose' );
function custom_image_size_names_choose( $sizes = array() ) {
	$sizes['gallery-thumb'] = __( 'Gallery thumb' );
	return $sizes;
}

The only thing we should be aware of is that the "size" parameter is added to the shortcode (imho it shouldn't, because this custom size may not be good for any theme we install afterwards).

Attachments (2)

custom-gallery-image-size.diff (687 bytes) - added by GregLone 5 years ago.
29032.diff (739 bytes) - added by michalzuber 5 years ago.
Rewrite to applicable via grunt patch

Download all attachments as: .zip

Change History (6)

@michalzuber
5 years ago

Rewrite to applicable via grunt patch

#1 @Clorith
5 years ago

  • Keywords has-patch added
  • Version changed from trunk to 3.9.2

#2 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#3 @GregLone
5 years ago

Sergey, thanks for the description modification, I saw my mistake too late and couldn't edit it.

#4 @wonderboymusic
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #18143.

the default value is always set for the shortcode now, and can be overridden in the Gallery Settings UI: since [29779].

Note: See TracTickets for help on using tickets.