Warning: This function has been deprecated. Use wp_should_skip_block_supports_serialization() instead.
Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness. Use wp_should_skip_block_supports_serialization() instead.
wp_skip_spacing_serialization() WordPress Function
The wp_skip_spacing_serialization() function is a utility function that allows you to skip the automatic spacing serialization that occurs when you update your WordPress site. This can be useful if you want to prevent your site from being automatically formatted or if you want to preserve the spacing of your content.
wp_skip_spacing_serialization( WP_Block_Type $block_type ) #
Checks whether serialization of the current block’s spacing properties should occur.
Description
See also
Parameters
- $block_type
(WP_Block_Type)(Required)Block type.
Return
(bool) Whether to serialize spacing support styles & classes.
Source
File: wp-includes/deprecated.php
function wp_skip_spacing_serialization( $block_type ) { _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); $spacing_support = _wp_array_get( $block_type->supports, array( 'spacing' ), false ); return is_array( $spacing_support ) && array_key_exists( '__experimentalSkipSerialization', $spacing_support ) && $spacing_support['__experimentalSkipSerialization']; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
6.0.0 | Use wp_should_skip_block_supports_serialization() introduced in 6.0.0. |
5.9.0 | Introduced. |