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