[wp-trac] [WordPress Trac] #22738: 3.5 Media: Correct display of dimensions for large-size images in size dropdown
WordPress Trac
noreply at wordpress.org
Thu Dec 6 14:57:28 UTC 2012
#22738: 3.5 Media: Correct display of dimensions for large-size images in size
dropdown
-------------------------------------------+---------------------
Reporter: jond3r | Owner: nacin
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 3.5
Component: Media | Version: trunk
Severity: normal | Resolution: fixed
Keywords: has-patch commit dev-reviewed |
-------------------------------------------+---------------------
Comment (by jond3r):
Replying to [comment:23 nacin]:
> More test code:
> {{{
> add_filter( 'image_size_names_choose', function( $sizes ) {
> $sizes['post-thumbnail'] = 'Post Thumbnail';
> return $sizes;
> } );
> }}}
>
> Constrain will kick in when a post thumbnail for a theme is larger than
its content width.
For the record, I tested the image_size_names_choose filter, and it works
as expected. (It's a really useful filter by the way.)
One thing to note is that for the "constrain to kick in" the theme must
also have registered the custom image size in question, using the function
add_image_size(), so that the size is in the $_wp_additional_image_sizes
array. I experienced this when using a theme that had not registered the
size 'post-thumbnail'.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22738#comment:28>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list