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
This commit is contained in:
Anthony Burchell 2020-09-17 14:40:47 +00:00
parent f5fc714cf6
commit 7da52b8eae

View File

@ -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;
}