diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/block-supports/spacing.php --- a/wp/wp-includes/block-supports/spacing.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-includes/block-supports/spacing.php Tue Sep 27 16:37:53 2022 +0200 @@ -1,6 +1,9 @@ $value ) { $styles[] = sprintf( 'padding-%s: %s;', $key, $value ); } + } elseif ( null !== $padding_value ) { + $styles[] = sprintf( 'padding: %s;', $padding_value ); } } - if ( $has_margin_support ) { + if ( $has_margin_support && ! $skip_margin ) { $margin_value = _wp_array_get( $block_attributes, array( 'style', 'spacing', 'margin' ), null ); - if ( null !== $margin_value ) { + if ( is_array( $margin_value ) ) { foreach ( $margin_value as $key => $value ) { $styles[] = sprintf( 'margin-%s: %s;', $key, $value ); } + } elseif ( null !== $margin_value ) { + $styles[] = sprintf( 'margin: %s;', $margin_value ); } } return empty( $styles ) ? array() : array( 'style' => implode( ' ', $styles ) ); } -/** - * Checks whether the current block type supports the spacing feature requested. - * - * @since 5.8.0 - * @access private - * - * @param WP_Block_Type $block_type Block type to check for support. - * @param string $feature Name of the feature to check support for. - * @param mixed $default Fallback value for feature support, defaults to false. - * - * @return boolean Whether or not the feature is supported. - */ -function wp_has_spacing_feature_support( $block_type, $feature, $default = false ) { - // Check if the specific feature has been opted into individually - // via nested flag under `spacing`. - return block_has_support( $block_type, array( 'spacing', $feature ), $default ); -} - // Register the block support. WP_Block_Supports::get_instance()->register( 'spacing',