Make WordPress Core


Ignore:
Timestamp:
09/26/2024 12:45:41 PM (8 months ago)
Author:
gziolo
Message:

Editor: Default attribute value not used with get_block_wrapper_attributes

Ensures that the default values defined in the schema for block attributes are used when rendering the output of the block with get_block_wrapper_attributes helper.

Props gziolo, jonsurrell, youknowriad, ryelle.
Fixes #62114.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-supports.php

    r58112 r59093  
    105105
    106106        $block_attributes = array_key_exists( 'attrs', self::$block_to_render ) && is_array( self::$block_to_render['attrs'] )
    107             ? self::$block_to_render['attrs']
     107            ? $block_type->prepare_attributes_for_render( self::$block_to_render['attrs'] )
    108108            : array();
    109109
Note: See TracChangeset for help on using the changeset viewer.