Make WordPress Core

Changeset 37724


Ignore:
Timestamp:
06/16/2016 09:44:21 AM (7 years ago)
Author:
ocean90
Message:

Customize: Separate preview and actions in the site icon control.

Reverts [37456] to allow users to remove/change a site icon even if the attachment has corrupt/missing data about sizes.

Fixes #36749.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php

    r37456 r37724  
    6060        </label>
    6161
    62         <# if ( data.attachment && data.attachment.id && data.attachment.sizes ) { #>
     62        <# if ( data.attachment && data.attachment.id ) { #>
    6363            <div class="attachment-media-view">
    64                 <div class="site-icon-preview">
    65                     <div class="favicon-preview">
    66                         <img src="<?php echo esc_url( admin_url( 'images/browser.png' ) ); ?>" class="browser-preview" width="182" alt="" />
     64                <# if ( data.attachment.sizes ) { #>
     65                    <div class="site-icon-preview">
     66                        <div class="favicon-preview">
     67                            <img src="<?php echo esc_url( admin_url( 'images/browser.png' ) ); ?>" class="browser-preview" width="182" alt="" />
    6768
    68                         <div class="favicon">
    69                             <img id="preview-favicon" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/>
     69                            <div class="favicon">
     70                                <img id="preview-favicon" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>"/>
     71                            </div>
     72                            <span class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span>
    7073                        </div>
    71                         <span class="browser-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></span>
     74                        <img class="app-icon-preview" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/>
    7275                    </div>
    73                     <img class="app-icon-preview" src="{{ data.attachment.sizes.full.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>"/>
    74                 </div>
     76                <# } #>
    7577                <div class="actions">
    7678                    <# if ( data.canUpload ) { #>
Note: See TracChangeset for help on using the changeset viewer.