Changeset 55774 for branches/5.9/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:21:39 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9/src/wp-includes/blocks.php
r53019 r55774 629 629 $result = ''; 630 630 631 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 632 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 633 } 634 631 635 $blocks = parse_blocks( $text ); 632 636 foreach ( $blocks as $block ) { … … 636 640 637 641 return $result; 642 } 643 644 /** 645 * Callback used for regular expression replacement in filter_block_content(). 646 * 647 * @private 648 * @since 6.2.1 649 * 650 * @param array $matches Array of preg_replace_callback matches. 651 * @return string Replacement string. 652 */ 653 function _filter_block_content_callback( $matches ) { 654 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 638 655 } 639 656
Note: See TracChangeset
for help on using the changeset viewer.