Changeset 55788 for branches/5.3/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:54:29 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.3/src/wp-includes/blocks.php
r46900 r55788 272 272 $result = ''; 273 273 274 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 275 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 276 } 277 274 278 $blocks = parse_blocks( $text ); 275 279 foreach ( $blocks as $block ) { … … 279 283 280 284 return $result; 285 } 286 287 /** 288 * Callback used for regular expression replacement in filter_block_content(). 289 * 290 * @private 291 * @since 6.2.1 292 * 293 * @param array $matches Array of preg_replace_callback matches. 294 * @return string Replacement string. 295 */ 296 function _filter_block_content_callback( $matches ) { 297 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 281 298 } 282 299
Note: See TracChangeset
for help on using the changeset viewer.