Changeset 42739
- Timestamp:
- 02/25/2018 04:40:33 PM (7 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-models.js
r41752 r42739 643 643 */ 644 644 validator: function( attachment ) { 645 646 // Filter out contextually created attachments (e.g. headers, logos, etc.). 647 if ( 648 ! _.isUndefined( attachment.attributes.context ) && 649 '' !== attachment.attributes.context 650 ) { 651 return false; 652 } 653 645 654 if ( ! this.validateDestroyed && attachment.destroyed ) { 646 655 return false; -
trunk/src/wp-includes/js/media-views.js
r42709 r42739 954 954 } 955 955 956 this._filterContext();957 this.get('library').on( 'add', this._filterContext, this );958 959 956 this.resetDisplays(); 960 957 }, … … 1158 1155 }, 1159 1156 1160 /**1161 * Filter out contextually created attachments (e.g. headers, logos, etc.)1162 *1163 * @since 4.9.01164 */1165 _filterContext: function() {1166 var library = this.get('library');1167 1168 library.set( library.filter( function( item ) {1169 return item.get('context') === '';1170 } ) );1171 }1172 1157 }); 1173 1158 -
trunk/src/wp-includes/js/media/controllers/library.js
r41937 r42739 86 86 } 87 87 88 this._filterContext();89 this.get('library').on( 'add', this._filterContext, this );90 91 88 this.resetDisplays(); 92 89 }, … … 290 287 }, 291 288 292 /**293 * Filter out contextually created attachments (e.g. headers, logos, etc.)294 *295 * @since 4.9.0296 */297 _filterContext: function() {298 var library = this.get('library');299 300 library.set( library.filter( function( item ) {301 return item.get('context') === '';302 } ) );303 }304 289 }); 305 290 -
trunk/src/wp-includes/js/media/models/attachments.js
r41351 r42739 152 152 */ 153 153 validator: function( attachment ) { 154 155 // Filter out contextually created attachments (e.g. headers, logos, etc.). 156 if ( 157 ! _.isUndefined( attachment.attributes.context ) && 158 '' !== attachment.attributes.context 159 ) { 160 return false; 161 } 162 154 163 if ( ! this.validateDestroyed && attachment.destroyed ) { 155 164 return false;
Note: See TracChangeset
for help on using the changeset viewer.