Make WordPress Core


Ignore:
Timestamp:
04/21/2023 10:41:58 AM (3 years 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/tests/phpunit/tests/admin/includesPost.php

    r54244 r55673  
    827827                        'render_callback' => 'foo',
    828828                        'ancestor'        => array( 'core/test-ancestor' ),
     829                        'selectors'       => array( 'root' => '.wp-block-test' ),
    829830                );
    830831
     
    846847                                ),
    847848                                'usesContext' => array(),
     849                                'selectors'   => array( 'root' => '.wp-block-test' ),
    848850                                'category'    => 'common',
    849851                                'styles'      => array(),
Note: See TracChangeset for help on using the changeset viewer.