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