Skip to content

Commit

Permalink
Update MediaField.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lavolpecheprogramma authored Sep 11, 2020
1 parent 2665d4a commit 2e246bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Aeria/Field/Fields/MediaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function get(array $saved_fields, bool $skip_filter = false)
}
foreach ($sizes as $size) {
$result[$size] = wp_get_attachment_image_src($value, $size);
$result[$size][3] = $result[$size][2] / $result[$size][1];
if ($result[$size][2] && $result[$size][1]) {
$result[$size][3] = $result[$size][2] / $result[$size][1];
}
}
} else {
$result['full'] = [wp_get_attachment_url($value)];
Expand Down

0 comments on commit 2e246bd

Please sign in to comment.