Make WordPress Core


Ignore:
Timestamp:
04/21/2023 10:41:58 AM (18 months ago)
Author:
gziolo
Message:

Editor: Add selectors field to block type definition

Adds support for the new selectors property for block types. It adds it to the allowed metadata when registering a block type, makes the WP_Block_Type class aware of it, exposes it through the block types REST API, and the get_block_editor_server_block_settings function.

Corresponding work in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/46496.

Fixes #57585.
Props aaronrobertshaw, hellofromTonya.

File:
1 edited

Legend:

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

    r55641 r55673  
    301301 * @since 5.9.0 Added support for `variations` and `viewScript` fields.
    302302 * @since 6.1.0 Added support for `render` field.
     303 * @since 6.3.0 Added `selectors` field.
    303304 *
    304305 * @param string $file_or_folder Path to the JSON file with metadata definition for
     
    383384        'providesContext' => 'provides_context',
    384385        'usesContext'     => 'uses_context',
     386        'selectors'       => 'selectors',
    385387        'supports'        => 'supports',
    386388        'styles'          => 'styles',
Note: See TracChangeset for help on using the changeset viewer.