Make WordPress Core


Ignore:
Timestamp:
01/31/2024 09:09:22 AM (2 years 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/src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php

    r56676 r57493  
    293293                'editor_style_handles',
    294294                'style_handles',
     295                'view_style_handles',
    295296                'variations',
    296297                'block_hooks',
     
    603604                    'readonly'    => true,
    604605                ),
     606                'view_style_handles'    => array(
     607                    'description' => __( 'Public facing style handles.' ),
     608                    'type'        => array( 'array' ),
     609                    'default'     => array(),
     610                    'items'       => array(
     611                        'type' => 'string',
     612                    ),
     613                    'context'     => array( 'embed', 'view', 'edit' ),
     614                    'readonly'    => true,
     615                ),
    605616                'styles'                => array(
    606617                    'description' => __( 'Block style variations.' ),
Note: See TracChangeset for help on using the changeset viewer.