From 8064f5dbc43d8957e6bf94991cbe1147e8853126 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 9 Mar 2014 01:05:48 +0000 Subject: [PATCH] In `wp.media.model.PostAudio` and `wp.media.model.PostVideo`, use Underscore's `unset` method when clearing out properties when the attachment changes. See #27016. git-svn-id: https://develop.svn.wordpress.org/trunk@27477 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-models.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/js/media-models.js b/src/wp-includes/js/media-models.js index ea3fed8093..1d22ac55a8 100644 --- a/src/wp-includes/js/media-models.js +++ b/src/wp-includes/js/media-models.js @@ -472,11 +472,11 @@ window.wp = window.wp || {}; if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) { this.set( this.extension, attachment.get( 'url' ) ); } else { - this.set( this.extension, '' ); + this.unset( this.extension ); } _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) { - self.set( ext, '' ); + self.unset( ext ); } ); } }); @@ -501,11 +501,11 @@ window.wp = window.wp || {}; if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) { this.set( this.extension, attachment.get( 'url' ) ); } else { - this.set( this.extension, '' ); + this.unset( this.extension ); } _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) { - self.set( ext, '' ); + self.unset( ext ); } ); } });