Skip to content

Commit

Permalink
Rich Text/Footnotes: fix getRichTextValues for useInnerBlocksProps.sa…
Browse files Browse the repository at this point in the history
…ve (#52682)

* Rich Text/Footnotes: fix getRichTextValues for useInnerBlocksProps.save

* Address feedback
  • Loading branch information
ellatrix authored Jul 17, 2023
1 parent abe7482 commit 4a55288
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,20 @@ function addValuesForElements( children, ...args ) {
}
}

function _getSaveElement( name, attributes, innerBlocks ) {
return getSaveElement(
name,
attributes,
innerBlocks.map( ( block ) =>
_getSaveElement( block.name, block.attributes, block.innerBlocks )
)
);
}

function addValuesForBlocks( values, blocks ) {
for ( let i = 0; i < blocks.length; i++ ) {
const { name, attributes, innerBlocks } = blocks[ i ];
const saveElement = getSaveElement( name, attributes );
const saveElement = _getSaveElement( name, attributes, innerBlocks );
addValuesForElement( saveElement, values, innerBlocks );
}
}
Expand Down

0 comments on commit 4a55288

Please sign in to comment.