Skip to content

Commit

Permalink
Add original_attachment_id meta
Browse files Browse the repository at this point in the history
Co-authored-by: Jonny Harris <spacedmonkey@users.noreply.github.com>
  • Loading branch information
ravichdev and spacedmonkey committed Jul 9, 2020
1 parent aea7cff commit 95eccf8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions php/class-hotlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ public function add_edited_attachment_metadata( $data, $new_attachment_id, $atta
$cropped = $this->is_cropped_image( $attachment_id );

if ( $unsplash_url && ! $cropped ) {
add_post_meta( $new_attachment_id, 'original_attachment_id', $attachment_id, true );
add_post_meta( $new_attachment_id, 'original_id', get_post_meta( $attachment_id, 'original_id', true ), true );
add_post_meta( $new_attachment_id, 'original_link', get_post_meta( $attachment_id, 'original_link', true ), true );
}
Expand Down

0 comments on commit 95eccf8

Please sign in to comment.