Editor: Add `__experimentalSkipSerialization` support to shadow.

Checks if `__experimentalSkipSerialization` is set and returns early from `wp_apply_shadow_support` if so.

Props colind, madhudollu, aaronrobertshaw, vcanales, isabel_brison, swissspidy, youknowriad.
Fixes #60784.

Built from https://develop.svn.wordpress.org/trunk@58312


git-svn-id: http://core.svn.wordpress.org/trunk@57769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
isabel_brison 2024-06-03 23:36:14 +00:00
parent ecb977b5e2
commit 357904a871
2 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,7 @@ function wp_register_shadow_support( $block_type ) {
* This will be applied to the block markup in the front-end. * This will be applied to the block markup in the front-end.
* *
* @since 6.3.0 * @since 6.3.0
* @since 6.6.0 Return early if __experimentalSkipSerialization is true.
* @access private * @access private
* *
* @param WP_Block_Type $block_type Block type. * @param WP_Block_Type $block_type Block type.
@ -52,7 +53,10 @@ function wp_register_shadow_support( $block_type ) {
function wp_apply_shadow_support( $block_type, $block_attributes ) { function wp_apply_shadow_support( $block_type, $block_attributes ) {
$has_shadow_support = block_has_support( $block_type, 'shadow', false ); $has_shadow_support = block_has_support( $block_type, 'shadow', false );
if ( ! $has_shadow_support ) { if (
! $has_shadow_support ||
wp_should_skip_block_supports_serialization( $block_type, 'shadow' )
) {
return array(); return array();
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6-alpha-58311'; $wp_version = '6.6-alpha-58312';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.