W3cubDocs

/WordPress

wp_skip_spacing_serialization( WP_Block_Type $block_type ): bool

Checks whether serialization of the current block’s spacing properties should occur.

Description

See also

Parameters

$block_typeWP_Block_Typerequired
Block type.

Return

bool Whether to serialize spacing support styles & classes.

Source

function wp_skip_spacing_serialization( $block_type ) {
	_deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );

	$spacing_support = isset( $block_type->supports['spacing'] )
		? $block_type->supports['spacing']
		: false;

	return is_array( $spacing_support ) &&
		array_key_exists( '__experimentalSkipSerialization', $spacing_support ) &&
		$spacing_support['__experimentalSkipSerialization'];
}

Changelog

Version Description
6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0.
5.9.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_skip_spacing_serialization