WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/23/2021 07:16:26 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for WP_Block_Type properties.

Add a reference to WP_Block_Type::__construct() for information on accepted arguments in register_block_type().

Synchronize the documentation between several places, use WP_Block_Type::__construct() as the canonical source.

Props ediamin, audrasjb, peterwilsoncc.
Fixes #48640.

File:
1 edited

Legend:

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

    r48629 r50419  
    3535     * @since 5.0.0
    3636     *
     37     * @see WP_Block_Type::__construct()
     38     *
    3739     * @param string|WP_Block_Type $name Block type name including namespace, or alternatively
    3840     *                                   a complete WP_Block_Type instance. In case a WP_Block_Type
    3941     *                                   is provided, the $args parameter will be ignored.
    40      * @param array                $args {
    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.
    44      *
    45      *     @type callable $render_callback Callback used to render blocks of this block type.
    46      *     @type array    $attributes      Block attributes mapping, property name to schema.
    47      * }
     42     * @param array                $args Optional. Array of block type arguments. Accepts any public property
     43     *                                   of `WP_Block_Type`. See WP_Block_Type::__construct() for information
     44     *                                   on accepted arguments. Default empty array.
    4845     * @return WP_Block_Type|false The registered block type on success, or false on failure.
    4946     */
Note: See TracChangeset for help on using the changeset viewer.