Changeset 55771 for branches/6.1/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:13:50 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1/src/wp-includes/blocks.php
r54520 r55771 795 795 $result = ''; 796 796 797 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 798 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 799 } 800 797 801 $blocks = parse_blocks( $text ); 798 802 foreach ( $blocks as $block ) { … … 802 806 803 807 return $result; 808 } 809 810 /** 811 * Callback used for regular expression replacement in filter_block_content(). 812 * 813 * @private 814 * @since 6.2.1 815 * 816 * @param array $matches Array of preg_replace_callback matches. 817 * @return string Replacement string. 818 */ 819 function _filter_block_content_callback( $matches ) { 820 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 804 821 } 805 822
Note: See TracChangeset
for help on using the changeset viewer.