Skip to content

Commit

Permalink
Image Block: Use source_url for media file link (#11254)
Browse files Browse the repository at this point in the history
* Use source_url for media file link URL in image block

* Account for external images in media file link
  • Loading branch information
earnjam authored Nov 1, 2018
1 parent 563e292 commit 5bdaf3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ImageEdit extends Component {
if ( value === LINK_DESTINATION_NONE ) {
href = undefined;
} else if ( value === LINK_DESTINATION_MEDIA ) {
href = this.props.attributes.url;
href = ( this.props.image && this.props.image.source_url ) || this.props.attributes.url;
} else if ( value === LINK_DESTINATION_ATTACHMENT ) {
href = this.props.image && this.props.image.link;
} else {
Expand Down

0 comments on commit 5bdaf3b

Please sign in to comment.