Skip to content

Commit 9881b24

Browse files
authored
Merge pull request #2616 from WordPress/fix/2612-empty-embed
Blocks: Save embed with empty markup when URL not selected
2 parents 6e663a4 + 14abbe7 commit 9881b24

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

blocks/library/embed/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ function getEmbedBlockSettings( { title, icon, category = 'embed', transforms, k
219219
save( { attributes } ) {
220220
const { url, caption, align } = attributes;
221221

222+
if ( ! url ) {
223+
return;
224+
}
225+
222226
return (
223227
<figure className={ align ? `align${ align }` : null }>
224228
{ `\n${ url }\n` /* URL needs to be on its own line. */ }

0 commit comments

Comments
 (0)