Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
Theme slug injection: Make the function recursive
  • Loading branch information
scruffian committed Sep 29, 2023
commit ce37ce4d9a0cf235c585dbf3b6619855f6d5202c
8 changes: 1 addition & 7 deletions packages/block-library/src/pattern/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ const PatternEdit = ( { attributes, clientId } ) => {
)
) {
block.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {
if (
innerBlock.name === 'core/template-part' &&
innerBlock.attributes.theme === undefined
) {
innerBlock.attributes.theme = currentThemeStylesheet;
}
return innerBlock;
return injectThemeAttributeInBlockTemplateContent( innerBlock );
} );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ function useStartPatterns( fallbackContent ) {
)
) {
block.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {
if (
innerBlock.name === 'core/template-part' &&
innerBlock.attributes.theme === undefined
) {
innerBlock.attributes.theme = currentThemeStylesheet;
}
return innerBlock;
return injectThemeAttributeInBlockTemplateContent( innerBlock );
} );
}

Expand Down