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