by Ryan Oeltjenbruns
Patterns are a way to group blocks together for reuse.
They reference the block, data for it, and sometimes render an HTML outline into the pattern itself.
<!-- wp:group {"className":"my-class"} -->
<div class="wp-block-group my-class">
<!-- wp:post-featured-image /-->
<!-- wp:post-content /-->
</div>
<!-- /wp:group -->
The block reference uses the plugin name and "slug" of the block for identification.
<!-- wp:group {"className":"my-class"} -->
Wrapping the block references (`wp:group`) in HTML comments allows the block editor to identify the proper block and render the content. Cleverly, if the block can't be identified, the reference doesn't render anything in the browser.
Pattern syntax is build much like HTML itself; some tags are self-closing, some are not.
<!-- wp:post-content /-->
^^ self closing
(had to word wrap)
Boooooooo.
Let's have a look under the hood!