In `wp.media.model.Attachments.filters.type()`, return `true` earlier if `type` isn't set.

Props vivekbhusal.
Fixes #32746.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-07-06 15:34:26 +00:00
parent fa1b659d29
commit c65b89be19
3 changed files with 8 additions and 4 deletions

View File

@ -897,14 +897,18 @@ var Attachments = Backbone.Collection.extend({
type: function( attachment ) {
var type = this.props.get('type'), atts = attachment.toJSON(), mime, found;
if ( ! type || ( _.isArray( type ) && ! type.length ) ) {
return true;
}
mime = atts.mime || ( atts.file && atts.file.type ) || '';
if ( _.isArray( type ) ) {
found = ! type.length || _.find( type, function (t) {
found = _.find( type, function (t) {
return -1 !== mime.indexOf( t );
} );
} else {
found = ! type || -1 !== mime.indexOf( type );
found = -1 !== mime.indexOf( type );
}
return found;

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta1-33090';
$wp_version = '4.3-beta1-33091';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.