Make WordPress Core


Ignore:
Timestamp:
04/06/2022 09:45:31 AM (3 years ago)
Author:
gziolo
Message:

Editor: Make block type aware of the ancestor field

The ancestor field was recently added to the block.json schema in Gutenberg. See: https://github.com/WordPress/gutenberg/pull/39894.

Props darerodz.
Fixes #55531.

File:
1 edited

Legend:

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

    r52652 r53084  
    6060
    6161    /**
     62     * Setting ancestor makes a block available only inside the specified
     63     * block types at any position of the ancestor's block subtree.
     64     *
     65     * @since 6.0.0
     66     * @var array|null
     67     */
     68    public $ancestor = null;
     69
     70    /**
    6271     * Block type icon.
    6372     *
     
    208217     * @since 5.8.0 Added the `variations` property.
    209218     * @since 5.9.0 Added the `view_script` property.
     219     * @since 6.0.0 Added the `ancestor` property.
    210220     *
    211221     * @see register_block_type()
     
    222232     *     @type array|null    $parent           Setting parent lets a block require that it is only
    223233     *                                           available when nested within the specified blocks.
     234     *     @type array|null    $ancestor         Setting ancestor makes a block available only inside the specified
     235     *                                           block types at any position of the ancestor's block subtree.
    224236     *     @type string|null   $icon             Block type icon.
    225237     *     @type string        $description      A detailed block type description.
Note: See TracChangeset for help on using the changeset viewer.