Skip to content

Commit

Permalink
Add better syntax to the retrieve the content in the next steps example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwelcher committed Apr 30, 2024
1 parent e47f5ee commit 08c8565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions templates/transforms/files/plugin/README.md.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ const transformers = {
blocks: [ 'core/cover' ],
transform: ( attributes, innerBlocks ) => {
const [ firstBlock ] = innerBlocks;
const { content } =
firstBlock.attributes || 'More that meets the eye!';
const content =
firstBlock?.attributes?.content ||
'More that meets the eye!';
return createBlock( 'block-developers-cookbook/transforms', {
message: content,
} );
Expand Down

0 comments on commit 08c8565

Please sign in to comment.