Changeset 53644 for trunk/src/wp-includes/blocks/cover.php
- Timestamp:
- 07/04/2022 12:04:45 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/cover.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/cover.php
r53377 r53644 33 33 $image = get_the_post_thumbnail( null, 'post-thumbnail', $attr ); 34 34 35 $content = str_replace( 36 '</span><div', 37 '</span>' . $image . '<div', 38 $content 39 ); 40 35 /* 36 * Inserts the featured image between the (1st) cover 'background' `span` and 'inner_container' `div`, 37 * and removes eventual withespace characters between the two (typically introduced at template level) 38 */ 39 $inner_container_start = '/<div\b[^>]+wp-block-cover__inner-container[\s|"][^>]*>/U'; 40 if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) { 41 $offset = $matches[0][1]; 42 $content = substr( $content, 0, $offset ) . $image . substr( $content, $offset ); 43 } 41 44 } else { 42 45 if ( in_the_loop() ) {
Note: See TracChangeset
for help on using the changeset viewer.