diff --git a/blocks/library/embed/index.js b/blocks/library/embed/index.js index 22a4fb98bd6eb..3488999e0109e 100644 --- a/blocks/library/embed/index.js +++ b/blocks/library/embed/index.js @@ -69,6 +69,11 @@ function getEmbedBlockSettings( { title, icon, category = 'embed' } ) { this.unmounting = true; } + getPhotoHtml( photo ) { + const photoPreview =

{

; + return wp.element.renderToString( photoPreview ); + } + doServerSideRender( event ) { if ( event ) { event.preventDefault(); @@ -88,6 +93,8 @@ function getEmbedBlockSettings( { title, icon, category = 'embed' } ) { const { html, type } = obj; if ( html ) { this.setState( { html, type } ); + } else if ( 'photo' === type ) { + this.setState( { html: this.getPhotoHtml( obj ), type } ); } else { this.setState( { error: true } ); }