WordPress.org

Make WordPress Core

Ticket #48640: 48640-2.diff

File 48640-2.diff, 9.4 KB (added by ediamin, 14 months ago)

Update param doc block for WP v5.5.0

  • src/wp-includes/blocks.php

    diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php
    index dfe642ab82..95a3198df3 100644
    a b  
    1616 *                                   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. 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.
    22  *
    23  *     @type callable $render_callback Callback used to render blocks of this block type.
     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.
     21 *
     22 *     @type string      $title            Human-readable block type label.
     23 *     @type string|null $category         Block type category classification, used in
     24 *                                         search interfaces to arrange block types by category.
     25 *     @type array|null  $parent           Setting parent lets a block require that it is only
     26 *                                         available when nested within the specified blocks.
     27 *     @type string|null $icon             Block type icon.
     28 *     @type string      $description      A detailed block type description.
     29 *     @type array       $keywords         Additional keywords to produce block type as
     30 *                                         result in search interfaces.
     31 *     @type string|null $textdomain       The translation textdomain.
     32 *     @type array       $styles           Alternative block styles.
     33 *     @type array|null  $supports         Supported features.
     34 *     @type array|null  $example          Structured data for the block preview.
     35 *     @type callable    $render_callback  Block type render callback.
     36 *     @type array|null  $attributes       Block type attributes property schemas.
     37 *     @type array       $uses_context     Context values inherited by blocks of this type.
     38 *     @type array|null  $provides_context Context provided by blocks of this type.
     39 *     @type string|null $editor_script    Block type editor script handle.
     40 *     @type string|null $script           Block type front end script handle.
     41 *     @type string|null $editor_style     Block type editor style handle.
     42 *     @type string|null $style            Block type front end style handle.
    2443 * }
    2544 * @return WP_Block_Type|false The registered block type on success, or false on failure.
    2645 */
  • src/wp-includes/class-wp-block-type-registry.php

    diff --git a/src/wp-includes/class-wp-block-type-registry.php b/src/wp-includes/class-wp-block-type-registry.php
    index e11cb9911a..a2bcb605ef 100644
    a b final class WP_Block_Type_Registry { 
    3838         *                                   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. 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.
     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.
     43         *
     44         *     @type string      $title            Human-readable block type label.
     45         *     @type string|null $category         Block type category classification, used in
     46         *                                         search interfaces to arrange block types by category.
     47         *     @type array|null  $parent           Setting parent lets a block require that it is only
     48         *                                         available when nested within the specified blocks.
     49         *     @type string|null $icon             Block type icon.
     50         *     @type string      $description      A detailed block type description.
     51         *     @type array       $keywords         Additional keywords to produce block type as
     52         *                                         result in search interfaces.
     53         *     @type string|null $textdomain       The translation textdomain.
     54         *     @type array       $styles           Alternative block styles.
     55         *     @type array|null  $supports         Supported features.
     56         *     @type array|null  $example          Structured data for the block preview.
     57         *     @type callable    $render_callback  Block type render callback.
     58         *     @type array|null  $attributes       Block type attributes property schemas.
     59         *     @type array       $uses_context     Context values inherited by blocks of this type.
     60         *     @type array|null  $provides_context Context provided by blocks of this type.
     61         *     @type string|null $editor_script    Block type editor script handle.
     62         *     @type string|null $script           Block type front end script handle.
     63         *     @type string|null $editor_style     Block type editor style handle.
     64         *     @type string|null $style            Block type front end style handle.
    4765         * }
    4866         * @return WP_Block_Type|false The registered block type on success, or false on failure.
    4967         */
  • src/wp-includes/class-wp-block-type.php

    diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php
    index 572c3c39c1..1b91ad9652 100644
    a b class WP_Block_Type { 
    2525        public $name;
    2626
    2727        /**
     28         * Human-readable block type label.
     29         *
    2830         * @since 5.5.0
    2931         * @var string
    3032         */
    3133        public $title = '';
    3234
    3335        /**
     36         * Block type category classification, used in search interfaces
     37         * to arrange block types by category.
     38         *
    3439         * @since 5.5.0
    3540         * @var string|null
    3641         */
    3742        public $category = null;
    3843
    3944        /**
     45         * Setting parent lets a block require that it is only available
     46         * when nested within the specified blocks.
     47         *
    4048         * @since 5.5.0
    4149         * @var array|null
    4250         */
    4351        public $parent = null;
    4452
    4553        /**
     54         * Block type icon.
     55         *
    4656         * @since 5.5.0
    4757         * @var string|null
    4858         */
    4959        public $icon = null;
    5060
    5161        /**
     62         * A detailed block type description.
     63         *
    5264         * @since 5.5.0
    5365         * @var string
    5466         */
    5567        public $description = '';
    5668
    5769        /**
     70         * Additional keywords to produce block type as result
     71         * in search interfaces.
     72         *
    5873         * @since 5.5.0
    5974         * @var array
    6075         */
    6176        public $keywords = array();
    6277
    6378        /**
     79         * The translation textdomain.
     80         *
    6481         * @since 5.5.0
    6582         * @var string|null
    6683         */
    6784        public $textdomain = null;
    6885
    6986        /**
     87         * Alternative block styles.
     88         *
    7089         * @since 5.5.0
    7190         * @var array
    7291         */
    7392        public $styles = array();
    7493
    7594        /**
     95         * Supported features.
     96         *
    7697         * @since 5.5.0
    7798         * @var array|null
    7899         */
    79100        public $supports = null;
    80101
    81102        /**
     103         * Structured data for the block preview.
     104         *
    82105         * @since 5.5.0
    83106         * @var array|null
    84107         */
    class WP_Block_Type { 
    158181         * @see register_block_type()
    159182         *
    160183         * @param string       $block_type Block type name including namespace.
    161          * @param array|string $args       Optional. Array or string of arguments for registering a block type.
    162          *                                 Default empty array.
     184         * @param array                $args {
     185         *     Optional. Array of block type arguments. Any arguments may be defined, however the
     186         *     ones described below are supported by default. Default empty array.
     187         *
     188         *     @type string      $title            Human-readable block type label.
     189         *     @type string|null $category         Block type category classification, used in
     190         *                                         search interfaces to arrange block types by category.
     191         *     @type array|null  $parent           Setting parent lets a block require that it is only
     192         *                                         available when nested within the specified blocks.
     193         *     @type string|null $icon             Block type icon.
     194         *     @type string      $description      A detailed block type description.
     195         *     @type array       $keywords         Additional keywords to produce block type as
     196         *                                         result in search interfaces.
     197         *     @type string|null $textdomain       The translation textdomain.
     198         *     @type array       $styles           Alternative block styles.
     199         *     @type array|null  $supports         Supported features.
     200         *     @type array|null  $example          Structured data for the block preview.
     201         *     @type callable    $render_callback  Block type render callback.
     202         *     @type array|null  $attributes       Block type attributes property schemas.
     203         *     @type array       $uses_context     Context values inherited by blocks of this type.
     204         *     @type array|null  $provides_context Context provided by blocks of this type.
     205         *     @type string|null $editor_script    Block type editor script handle.
     206         *     @type string|null $script           Block type front end script handle.
     207         *     @type string|null $editor_style     Block type editor style handle.
     208         *     @type string|null $style            Block type front end style handle.
     209         * }
    163210         */
    164211        public function __construct( $block_type, $args = array() ) {
    165212                $this->name = $block_type;