Make WordPress Core


Ignore:
Timestamp:
01/31/2024 09:09:22 AM (16 months ago)
Author:
gziolo
Message:

Editor: Add viewStyle property to block.json for frontend-only block styles

Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/54491.

For block scripts there was already script, viewScript and editorScript. For block styles there was only style and editorStyle. This brings the parity.

Props gaambo.
Fixes #59673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php

    r57315 r57493  
    558558        $data       = $response->get_data();
    559559        $properties = $data['schema']['properties'];
    560         $this->assertCount( 30, $properties );
     560        $this->assertCount( 31, $properties );
    561561        $this->assertArrayHasKey( 'api_version', $properties );
    562562        $this->assertArrayHasKey( 'name', $properties );
     
    583583        $this->assertArrayHasKey( 'editor_style_handles', $properties );
    584584        $this->assertArrayHasKey( 'style_handles', $properties );
     585        $this->assertArrayHasKey( 'view_style_handles', $properties, 'schema must contain view_style_handles' );
    585586        $this->assertArrayHasKey( 'is_dynamic', $properties );
    586587        // Deprecated properties.
Note: See TracChangeset for help on using the changeset viewer.