From 657b5095cf5fcc1e8a0f862c4321b4b302144110 Mon Sep 17 00:00:00 2001 From: Ella Date: Thu, 14 Dec 2023 11:38:10 +0100 Subject: [PATCH] fix util --- packages/block-editor/src/hooks/utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/hooks/utils.js b/packages/block-editor/src/hooks/utils.js index fd7a34ec67f967..7057441de00de2 100644 --- a/packages/block-editor/src/hooks/utils.js +++ b/packages/block-editor/src/hooks/utils.js @@ -545,14 +545,14 @@ export function createBlockListBlockFilter( features ) { } export function createBlockSaveFilter( features ) { - function extraPropsFromHooks( props ) { + function extraPropsFromHooks( props, name, attributes ) { features.reduce( ( accu, feature ) => { const { hasSupport, attributeKeys = [], addSaveProps } = feature; const neededProps = {}; for ( const key of attributeKeys ) { - if ( props.attributes[ key ] ) { - neededProps[ key ] = props.attributes[ key ]; + if ( attributes[ key ] ) { + neededProps[ key ] = attributes[ key ]; } } @@ -560,12 +560,12 @@ export function createBlockSaveFilter( features ) { // Skip rendering if none of the needed attributes are // set. ! Object.keys( neededProps ).length || - ! hasSupport( props.name ) + ! hasSupport( name ) ) { return accu; } - return addSaveProps( accu, props.name, neededProps ); + return addSaveProps( accu, name, neededProps ); }, props ); } addFilter(