Changeset 42848
- Timestamp:
- 03/18/2018 04:19:50 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
- Property svn:mergeinfo changed
/trunk merged: 42739-42740
- Property svn:mergeinfo changed
-
branches/4.9/src/wp-includes/js/media-models.js
r41752 r42848 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; -
branches/4.9/src/wp-includes/js/media-views.js
r42627 r42848 954 954 } 955 955 956 this._filterContext();957 this.get('library').on( 'add', this._filterContext, this );958 959 956 this.resetDisplays(); 960 957 }, … … 1156 1153 setUserSetting( 'libraryContent', mode ); 1157 1154 } 1158 },1159 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 1155 } 1156 1172 1157 }); 1173 1158 -
branches/4.9/src/wp-includes/js/media/controllers/library.js
r41937 r42848 86 86 } 87 87 88 this._filterContext();89 this.get('library').on( 'add', this._filterContext, this );90 91 88 this.resetDisplays(); 92 89 }, … … 288 285 setUserSetting( 'libraryContent', mode ); 289 286 } 290 },291 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 287 } 288 304 289 }); 305 290 -
branches/4.9/src/wp-includes/js/media/models/attachments.js
r41351 r42848 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.