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-admin/includes/post.php

    r55365 r55673  
    21792179 *
    21802180 * @since 5.0.0
     2181 * @since 6.3.0 Added `selectors` field.
    21812182 *
    21822183 * @return array An associative array of registered block data.
     
    21932194        'provides_context' => 'providesContext',
    21942195        'uses_context'     => 'usesContext',
     2196        'selectors'        => 'selectors',
    21952197        'supports'         => 'supports',
    21962198        'category'         => 'category',
Note: See TracChangeset for help on using the changeset viewer.