Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r41325 r42343  
    2323    preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}"
    2424    <#
    25     <?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
    26     ?>if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) {
    27         #> <?php echo $attr ?><#
     25    <?php
     26    foreach ( array( 'autoplay', 'loop' ) as $attr ) :
     27    ?>
     28    if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
     29        #> <?php echo $attr; ?><#
    2830    }
    2931    <?php endforeach ?>#>
     
    3335    <# } #>
    3436
    35     <?php foreach ( $audio_types as $type ):
    36     ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { #>
    37     <source src="{{ data.model.<?php echo $type ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" />
     37    <?php
     38    foreach ( $audio_types as $type ) :
     39    ?>
     40    <# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { #>
     41    <source src="{{ data.model.<?php echo $type; ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type; ?>' ] }}" />
    3842    <# } #>
    39     <?php endforeach;
    40 ?></audio>
     43    <?php
     44    endforeach;
     45?>
     46</audio>
    4147<?php
    4248}
     
    7076    } else {
    7177        h = data.model.height;
    72     }
     78     }
    7379
    7480    if ( w ) {
     
    9197    <# if ( h ) { #>height="{{ h }}"<# } #>
    9298    <?php
    93     $props = array( 'poster' => '', 'preload' => 'metadata' );
    94     foreach ( $props as $key => $value ):
     99    $props       = array(
     100        'poster'  => '',
     101        'preload' => 'metadata',
     102    );
     103    foreach ( $props as $key => $value ) :
    95104        if ( empty( $value ) ) {
    96         ?><#
    97         if ( ! _.isUndefined( data.model.<?php echo $key ?> ) && data.model.<?php echo $key ?> ) {
    98             #> <?php echo $key ?>="{{ data.model.<?php echo $key ?> }}"<#
     105        ?>
     106        <#
     107        if ( ! _.isUndefined( data.model.<?php echo $key; ?> ) && data.model.<?php echo $key; ?> ) {
     108            #> <?php echo $key; ?>="{{ data.model.<?php echo $key; ?> }}"<#
    99109        } #>
    100         <?php } else {
    101             echo $key ?>="{{ _.isUndefined( data.model.<?php echo $key ?> ) ? '<?php echo $value ?>' : data.model.<?php echo $key ?> }}"<?php
     110        <?php
     111        } else {
     112            echo $key
     113            ?>
     114            ="{{ _.isUndefined( data.model.<?php echo $key; ?> ) ? '<?php echo $value; ?>' : data.model.<?php echo $key; ?> }}"
     115            <?php
    102116        }
    103117    endforeach;
    104     ?><#
    105     <?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
    106     ?> if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) && data.model.<?php echo $attr ?> ) {
    107         #> <?php echo $attr ?><#
     118    ?>
     119    <#
     120    <?php
     121    foreach ( array( 'autoplay', 'loop' ) as $attr ) :
     122    ?>
     123     if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
     124        #> <?php echo $attr; ?><#
    108125    }
    109126    <?php endforeach ?>#>
     
    119136    } #>
    120137
    121     <?php foreach ( $video_types as $type ):
    122     ?><# if ( data.model.<?php echo $type ?> ) { #>
    123     <source src="{{ data.model.<?php echo $type ?> }}" type="{{ settings.embedMimes[ '<?php echo $type ?>' ] }}" />
     138    <?php
     139    foreach ( $video_types as $type ) :
     140    ?>
     141    <# if ( data.model.<?php echo $type; ?> ) { #>
     142    <source src="{{ data.model.<?php echo $type; ?> }}" type="{{ settings.embedMimes[ '<?php echo $type; ?>' ] }}" />
    124143    <# } #>
    125144    <?php endforeach; ?>
     
    140159    global $is_IE;
    141160    $class = 'media-modal wp-core-ui';
    142     if ( $is_IE && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false )
     161    if ( $is_IE && strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) !== false ) {
    143162        $class .= ' ie7';
     163    }
    144164    ?>
    145165    <!--[if lte IE 8]>
     
    197217            <?php
    198218            /** This action is documented in wp-admin/includes/media.php */
    199             do_action( 'upload_ui_over_quota' ); ?>
     219            do_action( 'upload_ui_over_quota' );
     220            ?>
    200221
    201222        <?php else : ?>
     
    230251                ?>
    231252
    232                 <p class="max-upload-size"><?php
     253                <p class="max-upload-size">
     254                <?php
    233255                    printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) );
    234                 ?></p>
     256                ?>
     257                </p>
    235258
    236259                <# if ( data.suggestedWidth && data.suggestedHeight ) { #>
     
    245268                <?php
    246269                /** This action is documented in wp-admin/includes/media.php */
    247                 do_action( 'post-upload-ui' ); ?>
     270                do_action( 'post-upload-ui' );
     271                ?>
    248272            </div>
    249273        <?php endif; ?>
     
    252276
    253277    <script type="text/html" id="tmpl-media-library-view-switcher">
    254         <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-list">
     278        <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-list">
    255279            <span class="screen-reader-text"><?php _e( 'List View' ); ?></span>
    256280        </a>
    257         <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ) ?>" class="view-grid current">
     281        <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-grid current">
    258282            <span class="screen-reader-text"><?php _e( 'Grid View' ); ?></span>
    259283        </a>
     
    338362            <span class="settings-save-status">
    339363                <span class="spinner"></span>
    340                 <span class="saved"><?php esc_html_e('Saved.'); ?></span>
     364                <span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
    341365            </span>
    342366            <div class="details">
     
    374398            <div class="settings">
    375399                <label class="setting" data-setting="url">
    376                     <span class="name"><?php _e('URL'); ?></span>
     400                    <span class="name"><?php _e( 'URL' ); ?></span>
    377401                    <input type="text" value="{{ data.url }}" readonly />
    378402                </label>
     
    380404                <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
    381405                <label class="setting" data-setting="title">
    382                     <span class="name"><?php _e('Title'); ?></span>
     406                    <span class="name"><?php _e( 'Title' ); ?></span>
    383407                    <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
    384408                </label>
    385409                <?php endif; ?>
    386410                <# if ( 'audio' === data.type ) { #>
    387                 <?php foreach ( array(
     411                <?php
     412                foreach ( array(
    388413                    'artist' => __( 'Artist' ),
    389                     'album' => __( 'Album' ),
    390                 ) as $key => $label ) : ?>
    391                 <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
    392                     <span class="name"><?php echo $label ?></span>
    393                     <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
     414                    'album'  => __( 'Album' ),
     415                ) as $key => $label ) :
     416                ?>
     417                <label class="setting" data-setting="<?php echo esc_attr( $key ); ?>">
     418                    <span class="name"><?php echo $label; ?></span>
     419                    <input type="text" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" />
    394420                </label>
    395421                <?php endforeach; ?>
     
    406432                <# } #>
    407433                <label class="setting" data-setting="description">
    408                     <span class="name"><?php _e('Description'); ?></span>
     434                    <span class="name"><?php _e( 'Description' ); ?></span>
    409435                    <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
    410436                </label>
     
    432458                <# } #>
    433459                <# if ( ! data.uploading && data.can.remove ) { #> |
    434                     <?php if ( MEDIA_TRASH ): ?>
     460                    <?php if ( MEDIA_TRASH ) : ?>
    435461                        <# if ( 'trash' === data.status ) { #>
    436462                            <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button>
     
    438464                            <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button>
    439465                        <# } #>
    440                     <?php else: ?>
     466                    <?php else : ?>
    441467                        <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button>
    442468                    <?php endif; ?>
     
    483509            if ( 'image' === data.type ) { #>
    484510                <input type="text" value="{{ data.caption }}" class="describe" data-setting="caption"
    485                     placeholder="<?php esc_attr_e('Caption this image&hellip;'); ?>" {{ maybeReadOnly }} />
     511                    placeholder="<?php esc_attr_e( 'Caption this image&hellip;' ); ?>" {{ maybeReadOnly }} />
    486512            <# } else { #>
    487513                <input type="text" value="{{ data.title }}" class="describe" data-setting="title"
    488514                    <# if ( 'video' === data.type ) { #>
    489                         placeholder="<?php esc_attr_e('Describe this video&hellip;'); ?>"
     515                        placeholder="<?php esc_attr_e( 'Describe this video&hellip;' ); ?>"
    490516                    <# } else if ( 'audio' === data.type ) { #>
    491                         placeholder="<?php esc_attr_e('Describe this audio file&hellip;'); ?>"
     517                        placeholder="<?php esc_attr_e( 'Describe this audio file&hellip;' ); ?>"
    492518                    <# } else { #>
    493                         placeholder="<?php esc_attr_e('Describe this media file&hellip;'); ?>"
     519                        placeholder="<?php esc_attr_e( 'Describe this media file&hellip;' ); ?>"
    494520                    <# } #> {{ maybeReadOnly }} />
    495521            <# }
     
    502528            <span class="settings-save-status">
    503529                <span class="spinner"></span>
    504                 <span class="saved"><?php esc_html_e('Saved.'); ?></span>
     530                <span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
    505531            </span>
    506532        </h2>
     
    535561
    536562                <# if ( ! data.uploading && data.can.remove ) { #>
    537                     <?php if ( MEDIA_TRASH ): ?>
     563                    <?php if ( MEDIA_TRASH ) : ?>
    538564                    <# if ( 'trash' === data.status ) { #>
    539565                        <button type="button" class="button-link untrash-attachment"><?php _e( 'Untrash' ); ?></button>
     
    541567                        <button type="button" class="button-link trash-attachment"><?php _ex( 'Trash', 'verb' ); ?></button>
    542568                    <# } #>
    543                     <?php else: ?>
     569                    <?php else : ?>
    544570                        <button type="button" class="button-link delete-attachment"><?php _e( 'Delete Permanently' ); ?></button>
    545571                    <?php endif; ?>
     
    555581
    556582        <label class="setting" data-setting="url">
    557             <span class="name"><?php _e('URL'); ?></span>
     583            <span class="name"><?php _e( 'URL' ); ?></span>
    558584            <input type="text" value="{{ data.url }}" readonly />
    559585        </label>
     
    561587        <?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
    562588        <label class="setting" data-setting="title">
    563             <span class="name"><?php _e('Title'); ?></span>
     589            <span class="name"><?php _e( 'Title' ); ?></span>
    564590            <input type="text" value="{{ data.title }}" {{ maybeReadOnly }} />
    565591        </label>
    566592        <?php endif; ?>
    567593        <# if ( 'audio' === data.type ) { #>
    568         <?php foreach ( array(
     594        <?php
     595        foreach ( array(
    569596            'artist' => __( 'Artist' ),
    570             'album' => __( 'Album' ),
    571         ) as $key => $label ) : ?>
    572         <label class="setting" data-setting="<?php echo esc_attr( $key ) ?>">
    573             <span class="name"><?php echo $label ?></span>
    574             <input type="text" value="{{ data.<?php echo $key ?> || data.meta.<?php echo $key ?> || '' }}" />
     597            'album'  => __( 'Album' ),
     598        ) as $key => $label ) :
     599        ?>
     600        <label class="setting" data-setting="<?php echo esc_attr( $key ); ?>">
     601            <span class="name"><?php echo $label; ?></span>
     602            <input type="text" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" />
    575603        </label>
    576604        <?php endforeach; ?>
    577605        <# } #>
    578606        <label class="setting" data-setting="caption">
    579             <span class="name"><?php _e('Caption'); ?></span>
     607            <span class="name"><?php _e( 'Caption' ); ?></span>
    580608            <textarea {{ maybeReadOnly }}>{{ data.caption }}</textarea>
    581609        </label>
    582610        <# if ( 'image' === data.type ) { #>
    583611            <label class="setting" data-setting="alt">
    584                 <span class="name"><?php _e('Alt Text'); ?></span>
     612                <span class="name"><?php _e( 'Alt Text' ); ?></span>
    585613                <input type="text" value="{{ data.alt }}" {{ maybeReadOnly }} />
    586614            </label>
    587615        <# } #>
    588616        <label class="setting" data-setting="description">
    589             <span class="name"><?php _e('Description'); ?></span>
     617            <span class="name"><?php _e( 'Description' ); ?></span>
    590618            <textarea {{ maybeReadOnly }}>{{ data.description }}</textarea>
    591619        </label>
     
    610638        <# if ( 'image' === data.type ) { #>
    611639            <label class="setting align">
    612                 <span><?php _e('Alignment'); ?></span>
     640                <span><?php _e( 'Alignment' ); ?></span>
    613641                <select class="alignment"
    614642                    data-setting="align"
     
    636664            <label>
    637665                <# if ( data.model.canEmbed ) { #>
    638                     <span><?php _e('Embed or Link'); ?></span>
     666                    <span><?php _e( 'Embed or Link' ); ?></span>
    639667                <# } else { #>
    640                     <span><?php _e('Link To'); ?></span>
     668                    <span><?php _e( 'Link To' ); ?></span>
    641669                <# } #>
    642670
     
    683711        <# if ( 'undefined' !== typeof data.sizes ) { #>
    684712            <label class="setting">
    685                 <span><?php _e('Size'); ?></span>
     713                <span><?php _e( 'Size' ); ?></span>
    686714                <select class="size" name="size"
    687715                    data-setting="size"
     
    691719                    <?php
    692720                    /** This filter is documented in wp-admin/includes/media.php */
    693                     $sizes = apply_filters( 'image_size_names_choose', array(
    694                         'thumbnail' => __('Thumbnail'),
    695                         'medium'    => __('Medium'),
    696                         'large'     => __('Large'),
    697                         'full'      => __('Full Size'),
    698                     ) );
    699 
    700                     foreach ( $sizes as $value => $name ) : ?>
     721                    $sizes = apply_filters(
     722                        'image_size_names_choose', array(
     723                            'thumbnail' => __( 'Thumbnail' ),
     724                            'medium'    => __( 'Medium' ),
     725                            'large'     => __( 'Large' ),
     726                            'full'      => __( 'Full Size' ),
     727                        )
     728                    );
     729
     730                    foreach ( $sizes as $value => $name ) :
     731                    ?>
    701732                        <#
    702733                        var size = data.sizes['<?php echo esc_js( $value ); ?>'];
     
    716747
    717748        <label class="setting">
    718             <span><?php _e('Link To'); ?></span>
     749            <span><?php _e( 'Link To' ); ?></span>
    719750            <select class="link-to"
    720751                data-setting="link"
     
    738769
    739770        <label class="setting">
    740             <span><?php _e('Columns'); ?></span>
     771            <span><?php _e( 'Columns' ); ?></span>
    741772            <select class="columns" name="columns"
    742773                data-setting="columns">
    743774                <?php for ( $i = 1; $i <= 9; $i++ ) : ?>
    744775                    <option value="<?php echo esc_attr( $i ); ?>" <#
    745                         if ( <?php echo $i ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# }
     776                        if ( <?php echo $i; ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# }
    746777                    #>>
    747778                        <?php echo esc_html( $i ); ?>
     
    766797                <?php
    767798                /** This filter is documented in wp-admin/includes/media.php */
    768                 $size_names = apply_filters( 'image_size_names_choose', array(
    769                     'thumbnail' => __( 'Thumbnail' ),
    770                     'medium'    => __( 'Medium' ),
    771                     'large'     => __( 'Large' ),
    772                     'full'      => __( 'Full Size' ),
    773                 ) );
    774 
    775                 foreach ( $size_names as $size => $label ) : ?>
     799                $size_names = apply_filters(
     800                    'image_size_names_choose', array(
     801                        'thumbnail' => __( 'Thumbnail' ),
     802                        'medium'    => __( 'Medium' ),
     803                        'large'     => __( 'Large' ),
     804                        'full'      => __( 'Full Size' ),
     805                    )
     806                );
     807
     808                foreach ( $size_names as $size => $label ) :
     809                ?>
    776810                    <option value="<?php echo esc_attr( $size ); ?>">
    777811                        <?php echo esc_html( $label ); ?>
     
    833867        <?php
    834868        /** This filter is documented in wp-admin/includes/media.php */
    835         if ( ! apply_filters( 'disable_captions', '' ) ) : ?>
     869        if ( ! apply_filters( 'disable_captions', '' ) ) :
     870        ?>
    836871            <label class="setting caption">
    837                 <span><?php _e('Caption'); ?></span>
     872                <span><?php _e( 'Caption' ); ?></span>
    838873                <textarea data-setting="caption" />
    839874            </label>
     
    841876
    842877        <label class="setting alt-text">
    843             <span><?php _e('Alt Text'); ?></span>
     878            <span><?php _e( 'Alt Text' ); ?></span>
    844879            <input type="text" data-setting="alt" />
    845880        </label>
    846881
    847882        <div class="setting align">
    848             <span><?php _e('Align'); ?></span>
     883            <span><?php _e( 'Align' ); ?></span>
    849884            <div class="button-group button-large" data-setting="align">
    850885                <button class="button" value="left">
     
    864899
    865900        <div class="setting link-to">
    866             <span><?php _e('Link To'); ?></span>
     901            <span><?php _e( 'Link To' ); ?></span>
    867902            <div class="button-group button-large" data-setting="link">
    868903                <button class="button" value="file">
     
    898933                    <?php
    899934                    /** This filter is documented in wp-admin/includes/media.php */
    900                     if ( ! apply_filters( 'disable_captions', '' ) ) : ?>
     935                    if ( ! apply_filters( 'disable_captions', '' ) ) :
     936                    ?>
    901937                        <label class="setting caption">
    902                             <span><?php _e('Caption'); ?></span>
     938                            <span><?php _e( 'Caption' ); ?></span>
    903939                            <textarea data-setting="caption">{{ data.model.caption }}</textarea>
    904940                        </label>
     
    906942
    907943                    <label class="setting alt-text">
    908                         <span><?php _e('Alternative Text'); ?></span>
     944                        <span><?php _e( 'Alternative Text' ); ?></span>
    909945                        <input type="text" data-setting="alt" value="{{ data.model.alt }}" />
    910946                    </label>
     
    912948                    <h2><?php _e( 'Display Settings' ); ?></h2>
    913949                    <div class="setting align">
    914                         <span><?php _e('Align'); ?></span>
     950                        <span><?php _e( 'Align' ); ?></span>
    915951                        <div class="button-group button-large" data-setting="align">
    916952                            <button class="button" value="left">
     
    932968                        <# if ( 'undefined' !== typeof data.attachment.sizes ) { #>
    933969                            <label class="setting size">
    934                                 <span><?php _e('Size'); ?></span>
     970                                <span><?php _e( 'Size' ); ?></span>
    935971                                <select class="size" name="size"
    936972                                    data-setting="size"
     
    940976                                    <?php
    941977                                    /** This filter is documented in wp-admin/includes/media.php */
    942                                     $sizes = apply_filters( 'image_size_names_choose', array(
    943                                         'thumbnail' => __('Thumbnail'),
    944                                         'medium'    => __('Medium'),
    945                                         'large'     => __('Large'),
    946                                         'full'      => __('Full Size'),
    947                                     ) );
    948 
    949                                     foreach ( $sizes as $value => $name ) : ?>
     978                                    $sizes = apply_filters(
     979                                        'image_size_names_choose', array(
     980                                            'thumbnail' => __( 'Thumbnail' ),
     981                                            'medium'    => __( 'Medium' ),
     982                                            'large'     => __( 'Large' ),
     983                                            'full'      => __( 'Full Size' ),
     984                                        )
     985                                    );
     986
     987                                    foreach ( $sizes as $value => $name ) :
     988                                    ?>
    950989                                        <#
    951990                                        var size = data.sizes['<?php echo esc_js( $value ); ?>'];
     
    9681007
    9691008                    <div class="setting link-to">
    970                         <span><?php _e('Link To'); ?></span>
     1009                        <span><?php _e( 'Link To' ); ?></span>
    9711010                        <select data-setting="link">
    9721011                        <# if ( data.attachment ) { #>
     
    9961035                            <div class="advanced-image">
    9971036                                <label class="setting title-text">
    998                                     <span><?php _e('Image Title Attribute'); ?></span>
     1037                                    <span><?php _e( 'Image Title Attribute' ); ?></span>
    9991038                                    <input type="text" data-setting="title" value="{{ data.model.title }}" />
    10001039                                </label>
    10011040                                <label class="setting extra-classes">
    1002                                     <span><?php _e('Image CSS Class'); ?></span>
     1041                                    <span><?php _e( 'Image CSS Class' ); ?></span>
    10031042                                    <input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" />
    10041043                                </label>
     
    10091048                                </div>
    10101049                                <label class="setting link-rel">
    1011                                     <span><?php _e('Link Rel'); ?></span>
     1050                                    <span><?php _e( 'Link Rel' ); ?></span>
    10121051                                    <input type="text" data-setting="linkRel" value="{{ data.model.linkRel }}" />
    10131052                                </label>
    10141053                                <label class="setting link-class-name">
    1015                                     <span><?php _e('Link CSS Class'); ?></span>
     1054                                    <span><?php _e( 'Link CSS Class' ); ?></span>
    10161055                                    <input type="text" data-setting="linkClassName" value="{{ data.model.linkClassName }}" />
    10171056                                </label>
     
    10381077        <div class="media-embed media-embed-details">
    10391078            <div class="embed-media-settings embed-audio-settings">
    1040                 <?php wp_underscore_audio_template() ?>
     1079                <?php wp_underscore_audio_template(); ?>
    10411080
    10421081                <# if ( ! _.isEmpty( data.model.src ) ) {
     
    10541093                <?php
    10551094
    1056                 foreach ( $audio_types as $type ):
    1057                 ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) {
    1058                     if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) {
    1059                         delete html5types.<?php echo $type ?>;
     1095                foreach ( $audio_types as $type ) :
     1096                ?>
     1097                <# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) {
     1098                    if ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) {
     1099                        delete html5types.<?php echo $type; ?>;
    10601100                    }
    10611101                #>
    10621102                <label class="setting">
    1063                     <span><?php echo strtoupper( $type ) ?></span>
    1064                     <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
     1103                    <span><?php echo strtoupper( $type ); ?></span>
     1104                    <input type="text" disabled="disabled" data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
    10651105                    <button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button>
    10661106                </label>
     
    10701110                <# if ( ! _.isEmpty( html5types ) ) { #>
    10711111                <div class="setting">
    1072                     <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ) ?></span>
     1112                    <span><?php _e( 'Add alternate sources for maximum HTML5 playback:' ); ?></span>
    10731113                    <div class="button-large">
    10741114                    <# _.each( html5types, function (mime, type) { #>
     
    11211161                #>
    11221162
    1123                 <?php wp_underscore_video_template() ?>
     1163                <?php wp_underscore_video_template(); ?>
    11241164
    11251165                <# if ( ! _.isEmpty( data.model.src ) ) {
     
    11351175                </label>
    11361176                <# } #>
    1137                 <?php foreach ( $video_types as $type ):
    1138                 ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) {
    1139                     if ( ! _.isUndefined( html5types.<?php echo $type ?> ) ) {
    1140                         delete html5types.<?php echo $type ?>;
     1177                <?php
     1178                foreach ( $video_types as $type ) :
     1179                ?>
     1180                <# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) {
     1181                    if ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) {
     1182                        delete html5types.<?php echo $type; ?>;
    11411183                    }
    11421184                #>
    11431185                <label class="setting">
    1144                     <span><?php echo strtoupper( $type ) ?></span>
    1145                     <input type="text" disabled="disabled" data-setting="<?php echo $type ?>" value="{{ data.model.<?php echo $type ?> }}" />
     1186                    <span><?php echo strtoupper( $type ); ?></span>
     1187                    <input type="text" disabled="disabled" data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" />
    11461188                    <button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button>
    11471189                </label>
Note: See TracChangeset for help on using the changeset viewer.