[wp-trac] [WordPress Trac] #19990: Separate ID and display name for add_image_size

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 9 15:14:33 UTC 2012


#19990: Separate ID and display name for add_image_size
-------------------------+------------------------------
 Reporter:  GaryJ        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  3.3.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by GaryJ):

 The Genesis Framework happens to use them for [http://d.pr/BsTk choosing a
 featured image size] - and other themes and plugins (I know one widget
 plugin that does) may well use them too.
 [http://www.deluxeblogtips.com/2011/06/list-registered-image-sizes.html
 This] is one example.

 Thinking ahead, `image_size_input_fields()` could make use of them if it
 were to automatically support showing images of all sizes.

 [http://www.studiograsshopper.ch/web-development/wordpress-featured-
 images-add_image_size-resizing-and-cropping-demo/#configure-add-image This
 tutorial] shows new image sizes being added, clearly with the name
 (spaces, capitals) being intended to be shown to a user. The fact that the
 variable is called `$name` instead of `$id` already makes it ambiguous in
 the eyes of some developers.

 The [http://wordpress.org/extend/plugins/simple-image-sizes/screenshots/
 Simple Image Sizes] plugin would look better if it could use a display
 name. This particular plugin also excellent highlights how having the
 current name / ID not translatable makes it look odd for non-native users.
 Same for the screenshot halfway down the [http://www.wpbeginner.com/wp-
 tutorials/how-to-create-additional-image-sizes-in-wordpress/ WPBeginner
 article] that references it, and ditto for
 [http://www.helenhousandi.com/wordpress/2011/02/showing-other-image-sizes-
 in-the-media-gallery-dialog/ Helen's post].

 [http://justintadlock.com/archives/2011/01/28/linking-to-all-image-sizes-
 in-wordpress Justin's tutorial] could be improved by showing a display
 name alongside the image dimensions, this time on the front-end.

 At this point, I'm only interested in getting the ID and a potential
 display name separated out, so that the latter could be made translatable.
 Clearly some themes and plugins that are already out there that do wish to
 show it to a user. My first pass solution is fully BC (I believe), and
 helps improve the UI where it's used for both same-language and different-
 language users.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19990#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list