Make WordPress Core

Changeset 48989


Ignore:
Timestamp:
09/17/2020 02:40:47 PM (4 years ago)
Author:
antpb
Message:

Media: Allow contextually generated images to show in Media Library grid view.
In grid view, contextually generated or cropped media is filtered out causing page numbering to be offset and incorrect. This also impacted any media utilizing media-models.js.
Props webmandesign, audrasjb, afercia, pbiron, mista-flo.
Fixes #46127, #50410, #47215.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/models/attachments.js

    r48650 r48989  
    152152    validator: function( attachment ) {
    153153
    154         // Filter out contextually created attachments (e.g. headers, logos, etc.).
    155         if (
    156             ! _.isUndefined( attachment.attributes.context ) &&
    157             '' !== attachment.attributes.context
    158         ) {
    159             return false;
    160         }
    161 
    162154        if ( ! this.validateDestroyed && attachment.destroyed ) {
    163155            return false;
Note: See TracChangeset for help on using the changeset viewer.