diff --git wp-includes/js/media-views.js wp-includes/js/media-views.js
index c932f21..1fc4e7e 100644
--- wp-includes/js/media-views.js
+++ wp-includes/js/media-views.js
@@ -4591,16 +4591,20 @@ EmbedLink = wp.media.view.Settings.extend({
if ( 'abort' === status ) {
return;
}
+
+ if ( response.data.type === 'not-embeddable' ) {
+ this.$( '.embed-container' ).show().find( '.embed-preview' ).html( '
' + response.data.message + '
' );
+ return;
+ }
+
this.$( '.link-text' ).show();
},
- renderoEmbed: function( response ) {
- var html = ( response && response.data && response.data.body ) || '';
-
- if ( html ) {
- this.$('.embed-container').show().find('.embed-preview').html( html );
+ renderoEmbed: function( response, status ) {
+ if ( response.success ) {
+ this.$( '.embed-container' ).show().find( '.embed-preview' ).html( response.data.body );
} else {
- this.renderFail();
+ this.renderFail(response, status);
}
}
});