Changeset 53157 for trunk/src/wp-includes/blocks/image.php
- Timestamp:
- 04/12/2022 03:10:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/image.php
r52364 r53157 10 10 * adding a data-id attribute to the element if core/gallery has added on pre-render. 11 11 * 12 * @param array $attributes The block attributes.13 * @param array$content The block content.12 * @param array $attributes The block attributes. 13 * @param string $content The block content. 14 14 * @return string Returns the block content with the data-id attribute added. 15 15 */ … … 21 21 // The data-id attribute is added in a core/gallery `render_block_data` hook. 22 22 $data_id_attribute = 'data-id="' . esc_attr( $attributes['data-id'] ) . '"'; 23 if ( !strpos( $content, $data_id_attribute ) ) {23 if ( false === strpos( $content, $data_id_attribute ) ) { 24 24 $content = str_replace( '<img', '<img ' . $data_id_attribute . ' ', $content ); 25 25 }
Note: See TracChangeset
for help on using the changeset viewer.