Changeset 52135 for trunk/src/wp-includes/block-supports/layout.php
- Timestamp:
- 11/11/2021 07:41:38 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/layout.php
r52103 r52135 221 221 */ 222 222 function wp_restore_group_inner_container( $block_content, $block ) { 223 $group_with_inner_container_regex = '/(^\s*<div\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/'; 223 $tag_name = isset( $block['attrs']['tagName'] ) ? $block['attrs']['tagName'] : 'div'; 224 $group_with_inner_container_regex = sprintf( 225 '/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/', 226 preg_quote( $tag_name, '/' ) 227 ); 224 228 225 229 if ( … … 232 236 } 233 237 234 $replace_regex = '/(^\s*<div\b[^>]*wp-block-group[^>]*>)(.*)(<\/div>\s*$)/ms'; 238 $replace_regex = sprintf( 239 '/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms', 240 preg_quote( $tag_name, '/' ) 241 ); 235 242 $updated_content = preg_replace_callback( 236 243 $replace_regex,
Note: See TracChangeset
for help on using the changeset viewer.