WordPress.org

Make WordPress Core

Changeset 34057


Ignore:
Timestamp:
09/11/2015 08:15:41 PM (5 years ago)
Author:
ocean90
Message:

Site Icon: For preview fall back to full size URL when thumbnail size doesn't exist.

Prevents a JavaScript error for rare cases when cropping is skipped and the image is smaller than thumbnail.

Merge of [34056] to the 4.3 branch.

Props tyxla.
See #33417.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3/src/wp-admin/js/customize-controls.js

    r33942 r34057  
    21642164         */
    21652165        setImageFromAttachment: function( attachment ) {
    2166             var icon = typeof attachment.sizes['site_icon-32'] !== 'undefined' ? attachment.sizes['site_icon-32'] : attachment.sizes.thumbnail;
     2166            var sizes = [ 'site_icon-32', 'thumbnail', 'full' ],
     2167                icon;
     2168
     2169            _.each( sizes, function( size ) {
     2170                if ( ! icon && ! _.isUndefined ( attachment.sizes[ size ] ) ) {
     2171                    icon = attachment.sizes[ size ];
     2172                }
     2173            } );
    21672174
    21682175            this.params.attachment = attachment;
     
    21702177            // Set the Customizer setting; the callback takes care of rendering.
    21712178            this.setting( attachment.id );
    2172 
    21732179
    21742180            // Update the icon in-browser.
Note: See TracChangeset for help on using the changeset viewer.