Changeset 55778 for branches/5.7/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:35:46 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.7/src/wp-includes/blocks.php
r50419 r55778 565 565 $result = ''; 566 566 567 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 568 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 569 } 570 567 571 $blocks = parse_blocks( $text ); 568 572 foreach ( $blocks as $block ) { … … 572 576 573 577 return $result; 578 } 579 580 /** 581 * Callback used for regular expression replacement in filter_block_content(). 582 * 583 * @private 584 * @since 6.2.1 585 * 586 * @param array $matches Array of preg_replace_callback matches. 587 * @return string Replacement string. 588 */ 589 function _filter_block_content_callback( $matches ) { 590 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 574 591 } 575 592
Note: See TracChangeset
for help on using the changeset viewer.