diff --git a/blocks/library/embed/index.js b/blocks/library/embed/index.js index fcae1b0d16b6eb..a8fd4081a9927d 100644 --- a/blocks/library/embed/index.js +++ b/blocks/library/embed/index.js @@ -123,9 +123,13 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k return; } response.json().then( ( obj ) => { - const { html, type, provider_name: providerName } = obj; + const { html, provider_name: providerName } = obj; const providerNameSlug = kebabCase( toLower( providerName ) ); + let { type } = obj; + if ( includes( html, 'class="wp-embedded-content" data-secret' ) ) { + type = 'wp-embed'; + } if ( html ) { this.setState( { html, type, providerNameSlug } ); setAttributes( { type, providerNameSlug } ); @@ -194,6 +198,20 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k const parsedUrl = parse( url ); const cannotPreview = includes( HOSTS_NO_PREVIEWS, parsedUrl.host.replace( /^www\./, '' ) ); const iframeTitle = sprintf( __( 'Embedded content from %s' ), parsedUrl.host ); + const embedWrapper = 'wp-embed' === type ? ( +
+ ) : ( +{ __( 'Previews for this are unavailable in the editor, sorry!' ) }
- ) : ( -