The Underscore templates for Gallery settings should respect defaults when marking an `<option>` as `selected`.

See #28693.

Built from https://develop.svn.wordpress.org/trunk@29283


git-svn-id: http://core.svn.wordpress.org/trunk@29065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-07-24 19:35:15 +00:00
parent 5be43cfeb1
commit 58741e0909
1 changed files with 8 additions and 4 deletions

View File

@ -678,13 +678,15 @@ function wp_print_media_templates() {
data-user-setting="urlbutton"
<# } #>>
<option value="post" selected>
<option value="post" <# if ( ! wp.media.galleryDefaults.link || 'post' == wp.media.galleryDefaults.link ) {
#>selected="selected"<# }
#>>
<?php esc_attr_e('Attachment Page'); ?>
</option>
<option value="file">
<option value="file" <# if ( 'file' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>>
<?php esc_attr_e('Media File'); ?>
</option>
<option value="none">
<option value="none" <# if ( 'none' == wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>>
<?php esc_attr_e('None'); ?>
</option>
</select>
@ -695,7 +697,9 @@ function wp_print_media_templates() {
<select class="columns" name="columns"
data-setting="columns">
<?php for ( $i = 1; $i <= 9; $i++ ) : ?>
<option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, 3 ); ?>>
<option value="<?php echo esc_attr( $i ); ?>" <#
if ( <?php echo $i ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# }
#>>
<?php echo esc_html( $i ); ?>
</option>
<?php endfor; ?>