Make WordPress Core


Ignore:
Timestamp:
02/02/2024 12:59:21 PM (16 months ago)
Author:
gziolo
Message:

Editor: Add allowed_blocks field to block registration and REST API

There is a new block.json field called allowedBlocks, added in Gutenberg in https://github.com/WordPress/gutenberg/pull/58262. This adds support for this new field also on the server.

Props: gziolo, jsnajdr.
Fixes #60403.

File:
1 edited

Legend:

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

    r57493 r57521  
    328328 * @since 6.3.0 Added `selectors` field.
    329329 * @since 6.4.0 Added support for `blockHooks` field.
    330  * @since 6.5.0 Added support for `viewStyle` field.
     330 * @since 6.5.0 Added support for `allowedBlocks` and `viewStyle` fields.
    331331 *
    332332 * @param string $file_or_folder Path to the JSON file with metadata definition for
     
    425425        'variations'      => 'variations',
    426426        'example'         => 'example',
     427        'allowedBlocks'   => 'allowed_blocks',
    427428    );
    428429    $textdomain        = ! empty( $metadata['textdomain'] ) ? $metadata['textdomain'] : null;
Note: See TracChangeset for help on using the changeset viewer.