Make WordPress Core


Ignore:
Timestamp:
01/31/2024 09:09:22 AM (3 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/class-wp-block-type.php

    r57315 r57493  
    234234         */
    235235        public $style_handles = array();
     236
     237        /**
     238         * Block type front end only style handles.
     239         *
     240         * @since 6.5.0
     241         * @var string[]
     242         */
     243        public $view_style_handles = array();
    236244
    237245        /**
     
    279287         * @since 6.3.0 Added the `selectors` property.
    280288         * @since 6.4.0 Added the `block_hooks` property.
     289         * @since 6.5.0 Added the `view_style_handles` property.
    281290         *
    282291         * @see register_block_type()
     
    316325         *     @type string[]      $editor_style_handles     Block type editor only style handles.
    317326         *     @type string[]      $style_handles            Block type front end and editor style handles.
     327         *     @type string[]      $view_style_handles       Block type front end only style handles.
    318328         * }
    319329         */
Note: See TracChangeset for help on using the changeset viewer.