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:
parent
359119a31e
commit
541796de46
|
@ -677,14 +677,6 @@ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachmen
|
||||||
*/
|
*/
|
||||||
validator: function( attachment ) {
|
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 ) {
|
if ( ! this.validateDestroyed && attachment.destroyed ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue