Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use rest of attributes when upgrading embed block
  • Loading branch information
fluiddot committed Jul 8, 2021
commit f9c347f369761c7b084e95dc5a18786f09a0bce4
17 changes: 3 additions & 14 deletions packages/block-library/src/embed/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,8 @@ export const createUpgradedEmbedBlock = (
props,
attributesFromPreview = {}
) => {
const {
preview,
attributes: {
align,
allowResponsive,
caption,
url,
providerNameSlug,
type,
} = {},
} = props;
const { preview, attributes = {} } = props;
const { url, providerNameSlug, type, ...restAttributes } = attributes;

if ( ! url || ! getBlockType( DEFAULT_EMBED_BLOCK ) ) return;

Expand All @@ -124,10 +115,8 @@ export const createUpgradedEmbedBlock = (
! providerNameSlug );
if ( shouldCreateNewBlock ) {
return createBlock( DEFAULT_EMBED_BLOCK, {
align,
allowResponsive,
caption,
url,
...restAttributes,
...matchedBlock.attributes,
} );
}
Expand Down