[wp-trac] [WordPress Trac] #64123: Patterns: add the pattern name to pattern blocks when they are converted
WordPress Trac
noreply at wordpress.org
Tue Oct 21 01:33:04 UTC 2025
#64123: Patterns: add the pattern name to pattern blocks when they are converted
-------------------------+--------------------------------------
Reporter: ramonopoly | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 7.0
Component: Editor | Version:
Severity: normal | Keywords: has-patch has-unit-tests
Focuses: |
-------------------------+--------------------------------------
The editor has used metadata in pattern attributes since
https://github.com/WordPress/gutenberg/pull/59251 to organize and sort
patterns.
Patterns metadata allows the editor to distinguish patterns from other
block groups, and from other patterns.
An initiative to introduce a special "simple" content only mode to
patterns depends on this feature. For user-created and inserted patterns,
the editor will render the block tree differently, and present specific
controls and tools to the user.
See: See: https://github.com/WordPress/gutenberg/issues/71517
The feature is slated for WordPress 7.0.
For this feature to work however, the block editor needs to know that it
is dealing with a pattern.
For patterns created in the editor, and for patterns returned by the
patterns REST API endpoint, the status of "pattern" can be inferred.
However, many templates contain patterns, for example TT5's 404 template
https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
content/themes/twentytwentyfive/templates/404.html#L5
The block editor ''could'' parse templates on the frontend to identify
patterns upon insertion, but this would have an impact on performance,
especially for large patterns.
Rather, let's leverage the existing patterns parser
`resolve_pattern_blocks` to add this metadata to theme patterns before
they're sent as a response from the REST APIs.
See: https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-
includes/blocks.php#L1843
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64123>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list