From da07ae873e4b5188a1b9a6a35e84f1e9272bc309 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 6 Apr 2022 04:24:05 +0000 Subject: [PATCH] Editor: Soft deprecate block supports functions. Reinstate the functions hard deprecated in [53076]: `wp_skip_border_serialization()`, `wp_skip_dimensions_serialization()` and `wp_skip_spacing_serialization()`. Props ramonopoly. See #55505. Built from https://develop.svn.wordpress.org/trunk@53082 git-svn-id: http://core.svn.wordpress.org/trunk@52671 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/deprecated.php | 60 ++++++++++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 684e0096db..7313f32a6e 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -4225,3 +4225,63 @@ function wp_render_duotone_filter_preset( $preset ) { _deprecated_function( __FUNCTION__, '5.9.1', 'wp_get_duotone_filter_property()' ); return wp_get_duotone_filter_property( $preset ); } + +/** + * Checks whether serialization of the current block's border properties should + * occur. + * + * @since 5.8.0 + * @access private + * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0. + * + * @param WP_Block_Type $block_type Block type. + * @return bool Whether serialization of the current block's border properties + * should occur. + */ +function wp_skip_border_serialization( $block_type ) { + _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); + $border_support = _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), false ); + + return is_array( $border_support ) && + array_key_exists( '__experimentalSkipSerialization', $border_support ) && + $border_support['__experimentalSkipSerialization']; +} + +/** + * Checks whether serialization of the current block's dimensions properties + * should occur. + * + * @since 5.9.0 + * @access private + * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0. + * + * @param WP_Block_type $block_type Block type. + * @return bool Whether to serialize spacing support styles & classes. + */ +function wp_skip_dimensions_serialization( $block_type ) { + _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); + $dimensions_support = _wp_array_get( $block_type->supports, array( '__experimentalDimensions' ), false ); + return is_array( $dimensions_support ) && + array_key_exists( '__experimentalSkipSerialization', $dimensions_support ) && + $dimensions_support['__experimentalSkipSerialization']; +} + +/** + * Checks whether serialization of the current block's spacing properties should + * occur. + * + * @since 5.9.0 + * @access private + * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0. + * + * @param WP_Block_Type $block_type Block type. + * @return bool Whether to serialize spacing support styles & classes. + */ +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']; +} diff --git a/wp-includes/version.php b/wp-includes/version.php index 6e124337cf..3b25f7fff2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53077'; +$wp_version = '6.0-alpha-53082'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.