Skip to content

Commit

Permalink
Merge pull request #2616 from WordPress/fix/2612-empty-embed
Browse files Browse the repository at this point in the history
Blocks: Save embed with empty markup when URL not selected
  • Loading branch information
aduth authored Sep 1, 2017
2 parents 6e663a4 + 14abbe7 commit 9881b24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/library/embed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
save( { attributes } ) {
const { url, caption, align } = attributes;

if ( ! url ) {
return;
}

return (
<figure className={ align ? `align${ align }` : null }>
{ `\n${ url }\n` /* URL needs to be on its own line. */ }
Expand Down

0 comments on commit 9881b24

Please sign in to comment.