Make WordPress Core

Changeset 53082


Ignore:
Timestamp:
04/06/2022 04:23:00 AM (3 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r52978 r53082  
    42264226    return wp_get_duotone_filter_property( $preset );
    42274227}
     4228
     4229/**
     4230 * Checks whether serialization of the current block's border properties should
     4231 * occur.
     4232 *
     4233 * @since 5.8.0
     4234 * @access private
     4235 * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0.
     4236 *
     4237 * @param WP_Block_Type $block_type Block type.
     4238 * @return bool Whether serialization of the current block's border properties
     4239 *              should occur.
     4240 */
     4241function wp_skip_border_serialization( $block_type ) {
     4242    _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
     4243    $border_support = _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), false );
     4244
     4245    return is_array( $border_support ) &&
     4246        array_key_exists( '__experimentalSkipSerialization', $border_support ) &&
     4247        $border_support['__experimentalSkipSerialization'];
     4248}
     4249
     4250/**
     4251 * Checks whether serialization of the current block's dimensions properties
     4252 * should occur.
     4253 *
     4254 * @since 5.9.0
     4255 * @access private
     4256 * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0.
     4257 *
     4258 * @param WP_Block_type $block_type Block type.
     4259 * @return bool Whether to serialize spacing support styles & classes.
     4260 */
     4261function wp_skip_dimensions_serialization( $block_type ) {
     4262    _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
     4263    $dimensions_support = _wp_array_get( $block_type->supports, array( '__experimentalDimensions' ), false );
     4264    return is_array( $dimensions_support ) &&
     4265        array_key_exists( '__experimentalSkipSerialization', $dimensions_support ) &&
     4266        $dimensions_support['__experimentalSkipSerialization'];
     4267}
     4268
     4269/**
     4270 * Checks whether serialization of the current block's spacing properties should
     4271 * occur.
     4272 *
     4273 * @since 5.9.0
     4274 * @access private
     4275 * @deprecated 6.0.0 Use `wp_should_skip_block_supports_serialization` introduced in 6.0.0.
     4276 *
     4277 * @param WP_Block_Type $block_type Block type.
     4278 * @return bool Whether to serialize spacing support styles & classes.
     4279 */
     4280function wp_skip_spacing_serialization( $block_type ) {
     4281    _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' );
     4282    $spacing_support = _wp_array_get( $block_type->supports, array( 'spacing' ), false );
     4283
     4284    return is_array( $spacing_support ) &&
     4285        array_key_exists( '__experimentalSkipSerialization', $spacing_support ) &&
     4286        $spacing_support['__experimentalSkipSerialization'];
     4287}
Note: See TracChangeset for help on using the changeset viewer.