Make WordPress Core


Ignore:
Timestamp:
04/26/2022 09:48:20 AM (2 years ago)
Author:
gziolo
Message:

Editor: Register 'lock' attribute for every block on the server

Backports changes from https://github.com/WordPress/gutenberg/pull/40468.

The lock attribute needs to be supported by every block, but currently, it is only done on the client site. As a result, it was causing block rendered API requests to fail when blocks are locked.

Props mamaduka, peterwilsoncc.
See #55567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/wpBlock.php

    r53152 r53268  
    8383
    8484        $this->assertInstanceOf( WP_Block_Type::class, $block->block_type );
    85         $this->assertSame(
    86             $block_type_settings['attributes'],
     85        $this->assertSameSetsWithIndex(
     86            array(
     87                'defaulted' => array(
     88                    'type'    => 'number',
     89                    'default' => 10,
     90                ),
     91                'lock'      => array( 'type' => 'object' ),
     92            ),
    8793            $block->block_type->attributes
    8894        );
Note: See TracChangeset for help on using the changeset viewer.