From 88e428a2e11676a5b6a94da6e2ac51c64e90a78f Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Thu, 17 Mar 2022 04:13:07 +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. Built from https://develop.svn.wordpress.org/trunk@52943 git-svn-id: http://core.svn.wordpress.org/trunk@52532 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-block-patterns-registry.php | 8 ++++++++ wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-block-patterns-registry.php b/wp-includes/class-wp-block-patterns-registry.php index 7066cb08d1..d84f7c775a 100644 --- a/wp-includes/class-wp-block-patterns-registry.php +++ b/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. * } diff --git a/wp-includes/version.php b/wp-includes/version.php index 4b0a6d97d0..280434ef38 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52942'; +$wp_version = '6.0-alpha-52943'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.