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.


Built from https://develop.svn.wordpress.org/trunk@48989


git-svn-id: http://core.svn.wordpress.org/trunk@48751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
antpb 2020-09-17 14:42:04 +00:00
parent 359119a31e
commit 541796de46
3 changed files with 2 additions and 10 deletions

View File

@ -677,14 +677,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;
}

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-alpha-48988';
$wp_version = '5.6-alpha-48989';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.