Skip to content

Commit 9d14669

Browse files
committed
Editor/Docs: Add blockTypes argument to WP_Block_Patterns_Registry::register() docblock.
Add the optional `blockTypes` argument in the patten properties for `WP_Block_Patterns_Registry::register()`. Props vlad.olaru. Fixes #55303. See #54729. git-svn-id: https://develop.svn.wordpress.org/trunk@52943 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3b8dc98 commit 9d14669

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/wp-includes/class-wp-block-patterns-registry.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ final class WP_Block_Patterns_Registry {
3333
* Registers a block pattern.
3434
*
3535
* @since 5.5.0
36+
* @since 5.8.0 Added support for the `blockTypes` property.
3637
*
3738
* @param string $pattern_name Block pattern name including namespace.
3839
* @param array $pattern_properties {
@@ -51,6 +52,13 @@ final class WP_Block_Patterns_Registry {
5152
* patterns. Block patterns can be shown on multiple categories.
5253
* A category must be registered separately in order to be used
5354
* here.
55+
* @type array $blockTypes Optional. A list of block names including namespace that could use
56+
* the block pattern in certain contexts (placeholder, transforms).
57+
* The block pattern is available in the block editor inserter
58+
* regardless of this list of block names.
59+
* Certain blocks support further specificity besides the block name
60+
* (e.g. for `core/template-part` you can specify areas
61+
* like `core/template-part/header` or `core/template-part/footer`).
5462
* @type array $keywords Optional. A list of aliases or keywords that help users discover the
5563
* pattern while searching.
5664
* }

0 commit comments

Comments
 (0)