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/rest-api/endpoints/class-wp-rest-block-types-controller.php

    r51786 r53084  
    267267            'keywords',
    268268            'parent',
     269            'ancestor',
    269270            'provides_context',
    270271            'uses_context',
     
    646647                    'readonly'    => true,
    647648                ),
     649                'ancestor'           => array(
     650                    'description' => __( 'Ancestor blocks.' ),
     651                    'type'        => array( 'array', 'null' ),
     652                    'items'       => array(
     653                        'type' => 'string',
     654                    ),
     655                    'default'     => null,
     656                    'context'     => array( 'embed', 'view', 'edit' ),
     657                    'readonly'    => true,
     658                ),
    648659                'keywords'         => $keywords_definition,
    649660                'example'          => $example_definition,
Note: See TracChangeset for help on using the changeset viewer.