Media: Improve backwards compatibility for image_size_names_choose filter. see #22186, #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-13 01:23:18 +00:00
parent 6f44d7c5bd
commit 65e35e3d76
1 changed files with 11 additions and 5 deletions

View File

@ -1587,19 +1587,25 @@ function wp_print_media_templates( $attachment ) {
'thumbnail' => __('Thumbnail'),
'medium' => __('Medium'),
'large' => __('Large'),
'full' => __('Full Size'),
) );
foreach ( $sizes as $value => $name ) : ?>
foreach ( $sizes as $value => $name ) :
if ( 'full' === $name )
continue;
?>
<# if ( sizes['<?php echo esc_js( $value ); ?>'] ) { #>
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'medium' ); ?>>
<?php echo esc_html( $name ); ?>
</option>
<# } #>>
<?php endforeach; ?>
<?php endforeach;
if ( ! empty( $sizes['full'] ) ) : ?>
<option value="full">
<?php echo esc_html_e( 'Full Size' ); ?>
<?php echo esc_html( $sizes['full'] ); ?>
</option>
<?php endif; ?>
</select>
</label>
<# } #>