Make WordPress Core

Changeset 52943


Ignore:
Timestamp:
03/17/2022 04:11:27 AM (5 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-patterns-registry.php

    r52236 r52943  
    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.
    … …  
    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.
Note: See TracChangeset for help on using the changeset viewer.