Changeset 55777 for branches/5.8/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:31:04 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8/src/wp-includes/blocks.php
r51681 r55777 621 621 $result = ''; 622 622 623 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 624 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 625 } 626 623 627 $blocks = parse_blocks( $text ); 624 628 foreach ( $blocks as $block ) { … … 628 632 629 633 return $result; 634 } 635 636 /** 637 * Callback used for regular expression replacement in filter_block_content(). 638 * 639 * @private 640 * @since 6.2.1 641 * 642 * @param array $matches Array of preg_replace_callback matches. 643 * @return string Replacement string. 644 */ 645 function _filter_block_content_callback( $matches ) { 646 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 630 647 } 631 648
Note: See TracChangeset
for help on using the changeset viewer.