Changeset 52069 for trunk/src/wp-includes/block-supports/border.php
- Timestamp:
- 11/09/2021 02:15:23 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/border.php
r51298 r52069 64 64 isset( $block_attributes['style']['border']['radius'] ) 65 65 ) { 66 $border_radius = (int) $block_attributes['style']['border']['radius']; 67 $styles[] = sprintf( 'border-radius: %dpx;', $border_radius ); 66 $border_radius = $block_attributes['style']['border']['radius']; 67 68 if ( is_array( $border_radius ) ) { 69 // We have individual border radius corner values. 70 foreach ( $border_radius as $key => $radius ) { 71 // Convert CamelCase corner name to kebab-case. 72 $corner = strtolower( preg_replace( '/(?<!^)[A-Z]/', '-$0', $key ) ); 73 $styles[] = sprintf( 'border-%s-radius: %s;', $corner, $radius ); 74 } 75 } else { 76 // This check handles original unitless implementation. 77 if ( is_numeric( $border_radius ) ) { 78 $border_radius .= 'px'; 79 } 80 81 $styles[] = sprintf( 'border-radius: %s;', $border_radius ); 82 } 68 83 } 69 84 … … 82 97 isset( $block_attributes['style']['border']['width'] ) 83 98 ) { 84 $border_width = intval( $block_attributes['style']['border']['width'] ); 85 $styles[] = sprintf( 'border-width: %dpx;', $border_width ); 99 $border_width = $block_attributes['style']['border']['width']; 100 101 // This check handles original unitless implementation. 102 if ( is_numeric( $border_width ) ) { 103 $border_width .= 'px'; 104 } 105 106 $styles[] = sprintf( 'border-width: %s;', $border_width ); 86 107 } 87 108
Note: See TracChangeset
for help on using the changeset viewer.