Changeset 55781 for branches/5.6/src/wp-includes/blocks.php
- Timestamp:
- 05/16/2023 03:40:27 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.6/src/wp-includes/blocks.php
r49694 r55781 488 488 $result = ''; 489 489 490 if ( false !== strpos( $text, '<!--' ) && false !== strpos( $text, '--->' ) ) { 491 $text = preg_replace_callback( '%<!--(.*?)--->%', '_filter_block_content_callback', $text ); 492 } 493 490 494 $blocks = parse_blocks( $text ); 491 495 foreach ( $blocks as $block ) { … … 495 499 496 500 return $result; 501 } 502 503 /** 504 * Callback used for regular expression replacement in filter_block_content(). 505 * 506 * @private 507 * @since 6.2.1 508 * 509 * @param array $matches Array of preg_replace_callback matches. 510 * @return string Replacement string. 511 */ 512 function _filter_block_content_callback( $matches ) { 513 return '<!--' . rtrim( $matches[1], '-' ) . '-->'; 497 514 } 498 515
Note: See TracChangeset
for help on using the changeset viewer.