In media.model.PostMedia
, for these 2 scenarios:
* `src` is set, and 'Add a Source' results in the same file (or a file with the same extension) being added * `src` is set, and 'Replace Audio|Video' is used, which will add a model property named by the attachment's extension ... call `model.unset( 'src' )`. See #27389. git-svn-id: https://develop.svn.wordpress.org/trunk@27536 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
12792afdde
commit
5e1e5c53ec
@ -467,6 +467,10 @@ window.wp = window.wp || {};
|
|||||||
this.attachment = attachment;
|
this.attachment = attachment;
|
||||||
this.extension = attachment.get('filename' ).split('.').pop();
|
this.extension = attachment.get('filename' ).split('.').pop();
|
||||||
|
|
||||||
|
if ( this.get( 'src' ) && this.extension === this.get( 'src' ).split('.').pop() ) {
|
||||||
|
this.unset( 'src' );
|
||||||
|
}
|
||||||
|
|
||||||
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
|
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) {
|
||||||
this.set( this.extension, this.attachment.get( 'url' ) );
|
this.set( this.extension, this.attachment.get( 'url' ) );
|
||||||
} else {
|
} else {
|
||||||
@ -479,6 +483,7 @@ window.wp = window.wp || {};
|
|||||||
|
|
||||||
this.setSource( attachment );
|
this.setSource( attachment );
|
||||||
|
|
||||||
|
this.unset( 'src' );
|
||||||
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
|
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
|
||||||
self.unset( ext );
|
self.unset( ext );
|
||||||
} );
|
} );
|
||||||
|
Loading…
Reference in New Issue
Block a user