Changeset 53076 for trunk/src/wp-includes/block-supports/border.php
- Timestamp:
- 04/05/2022 12:06:48 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/border.php
r52302 r53076 51 51 */ 52 52 function wp_apply_border_support( $block_type, $block_attributes ) { 53 if ( wp_s kip_border_serialization( $block_type) ) {53 if ( wp_should_skip_block_supports_serialization( $block_type, 'border' ) ) { 54 54 return array(); 55 55 } … … 61 61 if ( 62 62 wp_has_border_feature_support( $block_type, 'radius' ) && 63 isset( $block_attributes['style']['border']['radius'] ) 63 isset( $block_attributes['style']['border']['radius'] ) && 64 ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'radius' ) 64 65 ) { 65 66 $border_radius = $block_attributes['style']['border']['radius']; … … 85 86 if ( 86 87 wp_has_border_feature_support( $block_type, 'style' ) && 87 isset( $block_attributes['style']['border']['style'] ) 88 isset( $block_attributes['style']['border']['style'] ) && 89 ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'style' ) 88 90 ) { 89 91 $border_style = $block_attributes['style']['border']['style']; … … 94 96 if ( 95 97 wp_has_border_feature_support( $block_type, 'width' ) && 96 isset( $block_attributes['style']['border']['width'] ) 98 isset( $block_attributes['style']['border']['width'] ) && 99 ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'width' ) 97 100 ) { 98 101 $border_width = $block_attributes['style']['border']['width']; … … 107 110 108 111 // Border color. 109 if ( wp_has_border_feature_support( $block_type, 'color' ) ) { 112 if ( 113 wp_has_border_feature_support( $block_type, 'color' ) && 114 ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'color' ) 115 ) { 110 116 $has_named_border_color = array_key_exists( 'borderColor', $block_attributes ); 111 117 $has_custom_border_color = isset( $block_attributes['style']['border']['color'] ); … … 135 141 136 142 return $attributes; 137 }138 139 /**140 * Checks whether serialization of the current block's border properties should141 * occur.142 *143 * @since 5.8.0144 * @access private145 *146 * @param WP_Block_Type $block_type Block type.147 * @return bool Whether serialization of the current block's border properties148 * should occur.149 */150 function wp_skip_border_serialization( $block_type ) {151 $border_support = _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), false );152 153 return is_array( $border_support ) &&154 array_key_exists( '__experimentalSkipSerialization', $border_support ) &&155 $border_support['__experimentalSkipSerialization'];156 143 } 157 144
Note: See TracChangeset
for help on using the changeset viewer.