From 9d1466908b30efd91aba6302b2e18f8fe3a1c069 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 17 Mar 2022 04:11:27 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-wp-block-patterns-registry.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wp-includes/class-wp-block-patterns-registry.php b/src/wp-includes/class-wp-block-patterns-registry.php index 7066cb08d1..d84f7c775a 100644 --- a/src/wp-includes/class-wp-block-patterns-registry.php +++ b/src/wp-includes/class-wp-block-patterns-registry.php @@ -33,6 +33,7 @@ final class WP_Block_Patterns_Registry { * Registers a block pattern. * * @since 5.5.0 + * @since 5.8.0 Added support for the `blockTypes` property. * * @param string $pattern_name Block pattern name including namespace. * @param array $pattern_properties { @@ -51,6 +52,13 @@ final class WP_Block_Patterns_Registry { * patterns. Block patterns can be shown on multiple categories. * A category must be registered separately in order to be used * here. + * @type array $blockTypes Optional. A list of block names including namespace that could use + * the block pattern in certain contexts (placeholder, transforms). + * The block pattern is available in the block editor inserter + * regardless of this list of block names. + * Certain blocks support further specificity besides the block name + * (e.g. for `core/template-part` you can specify areas + * like `core/template-part/header` or `core/template-part/footer`). * @type array $keywords Optional. A list of aliases or keywords that help users discover the * pattern while searching. * }