@@ -145,18 +272,20 @@ export default function ReusableBlockEdit( {
}
return (
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
);
}
diff --git a/packages/block-library/src/block/index.php b/packages/block-library/src/block/index.php
index d51b35d68b23d..b7d3474e537e1 100644
--- a/packages/block-library/src/block/index.php
+++ b/packages/block-library/src/block/index.php
@@ -41,6 +41,21 @@ function render_block_core_block( $attributes ) {
$seen_refs[ $attributes['ref'] ] = true;
+ $filter_block_context = static function( $context ) use ( $attributes ) {
+ if ( isset( $attributes['dynamicContent'] ) && $attributes['dynamicContent'] ) {
+ $context['dynamicContent'] = $attributes['dynamicContent'];
+ }
+
+ return $context;
+ };
+
+ /**
+ * We set the `dynamicContent` context through the `render_block_context`
+ * filter so that it is available when a pattern's inner blocks are
+ * rendering via do_blocks given it only receives the inner content.
+ */
+ add_filter( 'render_block_context', $filter_block_context, 1 );
+
// Handle embeds for reusable blocks.
global $wp_embed;
$content = $wp_embed->run_shortcode( $reusable_block->post_content );
@@ -48,6 +63,9 @@ function render_block_core_block( $attributes ) {
$content = do_blocks( $content );
unset( $seen_refs[ $attributes['ref'] ] );
+
+ remove_filter( 'render_block_context', $filter_block_context, 1 );
+
return $content;
}
diff --git a/packages/block-library/src/heading/block.json b/packages/block-library/src/heading/block.json
index 7c018f8472cb4..9cbeff8e89eeb 100644
--- a/packages/block-library/src/heading/block.json
+++ b/packages/block-library/src/heading/block.json
@@ -14,7 +14,7 @@
"content": {
"type": "string",
"source": "html",
- "selector": "h1,h2,h3,h4,h5,h6",
+ "selector": "h2",
"default": "",
"__experimentalRole": "content"
},
@@ -63,7 +63,8 @@
}
},
"__unstablePasteTextInline": true,
- "__experimentalSlashInserter": true
+ "__experimentalSlashInserter": true,
+ "__experimentalConnections": true
},
"editorStyle": "wp-block-heading-editor",
"style": "wp-block-heading"