diff --git a/packages/block-library/src/query/utils.js b/packages/block-library/src/query/utils.js index 5dac08b81c3536..73af87f684e2a4 100644 --- a/packages/block-library/src/query/utils.js +++ b/packages/block-library/src/query/utils.js @@ -213,6 +213,7 @@ export const getTransformedBlocksFromPattern = ( ) => { const { query: { postType, inherit }, + namespace, } = queryBlockAttributes; const clonedBlocks = blocks.map( ( block ) => cloneBlock( block ) ); const queryClientIds = []; @@ -225,6 +226,9 @@ export const getTransformedBlocksFromPattern = ( postType, inherit, }; + if ( namespace ) { + block.attributes.namespace = namespace; + } queryClientIds.push( block.clientId ); } block.innerBlocks?.forEach( ( innerBlock ) => {