Skip to content

Commit

Permalink
Add data-id to image to help with compatibility of refactored gallery…
Browse files Browse the repository at this point in the history
… with existing themes and plugins (#30710)

Co-authored-by: Glen Davies <glen.davies@a8c.com>
  • Loading branch information
glendaviesnz and Glen Davies committed Apr 22, 2021
1 parent 991437d commit a2253ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export default function Image( {
<img
src={ temporaryURL || url }
alt={ defaultedAlt }
data-id={ id ? id : null }
onClick={ onImageClick }
onError={ () => onImageError() }
onLoad={ ( event ) => {
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/image/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default function save( { attributes } ) {
width={ width }
height={ height }
title={ title }
data-id={ id ? id : null }
/>
);

Expand Down

0 comments on commit a2253ec

Please sign in to comment.