Make WordPress Core

Ticket #26959: 26959-ensure-thumbnail.diff

File 26959-ensure-thumbnail.diff, 678 bytes (added by adamsilverstein, 11 years ago)

ensure a thumbnail size is available, use full size where missing

  • src/wp-includes/js/mce-view.js

     
    279279                                        columns: attrs.columns ? parseInt( attrs.columns, 10 ) : 3
    280280                                };
    281281
     282                                // Ensure that each image has a thumnail size, copying full size where missing
     283                                options.attachments = _.map( options.attachments, function( img ) {
     284                                                                                                if ( 'undefined' === typeof img.sizes.thumbnail ) {
     285                                                                                                        img.sizes.thumbnail = img.sizes.full;
     286                                                                                                }
     287                                                                                                return img;
     288                                                                                        });
    282289                                return this.template( options );
    283290
    284291                        }