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

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 8 17:19:01 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       |   Keywords:
-------------------------+-----------------------------
 Currently, the first argument in `add_image_size()` is used as both the id
 (and key in the global array `_wp_additional_image_sizes`, and as the
 displayed name, since nothing else is available.

 As such, the `$name`, when it is displayed, is not translatable, since
 some other code might be hard-coded to use a specific image size.

 Instead of adding a 5th argument to the function, one solution might be to
 allow the first argument to be a string or array, and if it is an array,
 passing that as a new item in the array that is set. Theme or plugin
 authors could then check for the existence of this array value item,
 before falling back to using the key as per now.

 Current Usage:
 {{{
 add_image_size( 'primary-sidebar', 150, 100 );
 }}}

 New Optional Usage:
 {{{
 add_image_size( array( 'primary-sidebar' => __( 'Primary Sidebar', 'my-
 textdomain' ) ), 150, 100 );
 }}}

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


More information about the wp-trac mailing list