From 7da52b8eae619c12f6702838bf458aca85f5f720 Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Thu, 17 Sep 2020 14:40:47 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@48989 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/media/models/attachments.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/js/media/models/attachments.js b/src/js/media/models/attachments.js index 2819093093..f80cac42f6 100644 --- a/src/js/media/models/attachments.js +++ b/src/js/media/models/attachments.js @@ -151,14 +151,6 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen */ validator: function( attachment ) { - // Filter out contextually created attachments (e.g. headers, logos, etc.). - if ( - ! _.isUndefined( attachment.attributes.context ) && - '' !== attachment.attributes.context - ) { - return false; - } - if ( ! this.validateDestroyed && attachment.destroyed ) { return false; }