[wp-trac] [WordPress Trac] #29032: Make gallery images size customizable in the editor

WordPress Trac noreply at wordpress.org
Tue Sep 9 07:05:10 UTC 2014


#29032: Make gallery images size customizable in the editor
-----------------------------+------------------------------
 Reporter:  GregLone         |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Gallery          |     Version:  3.9.2
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  javascript
-----------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> 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).

New description:

 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).

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29032#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list