Changeset 53012
- Timestamp:
- 03/29/2022 01:04:24 PM (14 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/duotone.php
r52768 r53012 521 521 522 522 $filter_preset = array( 523 'slug' => uniqid(),523 'slug' => wp_unique_id( sanitize_key( implode( '-', $block['attrs']['style']['color']['duotone'] ) . '-' ) ), 524 524 'colors' => $block['attrs']['style']['color']['duotone'], 525 525 ); -
trunk/src/wp-includes/block-supports/elements.php
r52743 r53012 37 37 } 38 38 39 $class_name = 'wp-elements-' . uniqid();39 $class_name = wp_unique_id( 'wp-elements-' ); 40 40 41 41 if ( strpos( $link_color, 'var:preset|color|' ) !== false ) { -
trunk/src/wp-includes/block-supports/layout.php
r52924 r53012 159 159 } 160 160 161 $ id = uniqid();162 $gap_value = _wp_array_get( $block, array( 'attrs', 'style', 'spacing', 'blockGap' ) );161 $class_name = wp_unique_id( 'wp-container-' ); 162 $gap_value = _wp_array_get( $block, array( 'attrs', 'style', 'spacing', 'blockGap' ) ); 163 163 // Skip if gap value contains unsupported characters. 164 164 // Regex for CSS value borrowed from `safecss_filter_attr`, and used here 165 165 // because we only want to match against the value, not the CSS attribute. 166 166 $gap_value = preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value; 167 $style = wp_get_layout_style( ". wp-container-$id", $used_layout, $has_block_gap_support, $gap_value );167 $style = wp_get_layout_style( ".$class_name", $used_layout, $has_block_gap_support, $gap_value ); 168 168 // This assumes the hook only applies to blocks with a single wrapper. 169 169 // I think this is a reasonable limitation for that particular hook. 170 170 $content = preg_replace( 171 171 '/' . preg_quote( 'class="', '/' ) . '/', 172 'class=" wp-container-' . $id. ' ',172 'class="' . esc_attr( $class_name ) . ' ', 173 173 $block_content, 174 174 1 -
trunk/tests/phpunit/tests/block-supports/elements.php
r52264 r53012 12 12 */ 13 13 private static function make_unique_id_one( $string ) { 14 return preg_replace( '/wp-elements- .{13}/', 'wp-elements-1', $string );14 return preg_replace( '/wp-elements-\d+/', 'wp-elements-1', $string ); 15 15 } 16 16
Note: See TracChangeset
for help on using the changeset viewer.