Make WordPress Core

Changeset 48629


Ignore:
Timestamp:
07/26/2020 10:15:20 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add a note that the $args parameter of register_block_type() accepts any public property of WP_Block_Type.

Follow-up to [47754].

Props ediamin.
See #48640.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r48573 r48629  
    1313 * @since 5.0.0
    1414 *
    15  * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
    16  *                                   complete WP_Block_Type instance. In case a WP_Block_Type
     15 * @param string|WP_Block_Type $name Block type name including namespace, or alternatively
     16 *                                   a complete WP_Block_Type instance. In case a WP_Block_Type
    1717 *                                   is provided, the $args parameter will be ignored.
    1818 * @param array                $args {
    19  *     Optional. Array of block type arguments. Any arguments may be defined, however the
    20  *     ones described below are supported by default. Default empty array.
     19 *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
     20 *     Any arguments may be defined, however the ones described below are supported by default.
     21 *     Default empty array.
    2122 *
    2223 *     @type callable $render_callback Callback used to render blocks of this block type.
     
    3334 * @since 5.0.0
    3435 *
    35  * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
    36  *                                   complete WP_Block_Type instance.
     36 * @param string|WP_Block_Type $name Block type name including namespace, or alternatively
     37 *                                   a complete WP_Block_Type instance.
    3738 * @return WP_Block_Type|false The unregistered block type on success, or false on failure.
    3839 */
     
    8384/**
    8485 * Finds a script handle for the selected block metadata field. It detects
    85  * when a path to file was provided and finds a corresponding
    86  * asset file with details necessary to register the script under
    87  * automatically generated handle name. It returns unprocessed script handle
    88  * otherwise.
     86 * when a path to file was provided and finds a corresponding asset file
     87 * with details necessary to register the script under automatically
     88 * generated handle name. It returns unprocessed script handle otherwise.
    8989 *
    9090 * @since 5.5.0
     
    171171 *                               the block or path to the folder where the `block.json` file is located.
    172172 * @param array  $args {
    173  *     Optional. Array of block type arguments. Any arguments may be defined, however the
    174  *     ones described below are supported by default. Default empty array.
     173 *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
     174 *     Any arguments may be defined, however the ones described below are supported by default.
     175 *     Default empty array.
    175176 *
    176177 *     @type callable $render_callback Callback used to render blocks of this block type.
  • trunk/src/wp-includes/class-wp-block-type-registry.php

    r47754 r48629  
    3535     * @since 5.0.0
    3636     *
    37      * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
    38      *                                   complete WP_Block_Type instance. In case a WP_Block_Type
     37     * @param string|WP_Block_Type $name Block type name including namespace, or alternatively
     38     *                                   a complete WP_Block_Type instance. In case a WP_Block_Type
    3939     *                                   is provided, the $args parameter will be ignored.
    4040     * @param array                $args {
    41      *     Optional. Array of block type arguments. Any arguments may be defined, however the
    42      *     ones described below are supported by default. Default empty array.
     41     *     Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`.
     42     *     Any arguments may be defined, however the ones described below are supported by default.
     43     *     Default empty array.
    4344     *
    4445     *     @type callable $render_callback Callback used to render blocks of this block type.
    4546     *     @type array    $attributes      Block attributes mapping, property name to schema.
    46      *                                     Accepts any public property of `WP_Block_Type`.
    4747     * }
    4848     * @return WP_Block_Type|false The registered block type on success, or false on failure.
     
    9595     * @since 5.0.0
    9696     *
    97      * @param string|WP_Block_Type $name Block type name including namespace, or alternatively a
    98      *                                   complete WP_Block_Type instance.
     97     * @param string|WP_Block_Type $name Block type name including namespace, or alternatively
     98     *                                   a complete WP_Block_Type instance.
    9999     * @return WP_Block_Type|false The unregistered block type on success, or false on failure.
    100100     */
Note: See TracChangeset for help on using the changeset viewer.