Skip to content

Commit

Permalink
fix: cropping behaviour being inconsistent with due to variable reset…
Browse files Browse the repository at this point in the history
… in image parsing loop
  • Loading branch information
selul committed Mar 27, 2019
1 parent 68c04ee commit 2b14e7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/tag_replacer.php
Expand Up @@ -67,6 +67,7 @@ public function process_image_tags( $content, $images = array() ) {
$sizes2crop = self::size_to_crop();
foreach ( $images[0] as $index => $tag ) {
$width = $height = false;
$crop = null;
$image_tag = $images['img_tag'][ $index ];

$is_slashed = strpos( $images['img_url'][ $index ], '\/' ) !== false;
Expand Down Expand Up @@ -105,7 +106,7 @@ public function process_image_tags( $content, $images = array() ) {
}
if ( empty( $resize ) && isset( $sizes2crop[ $width . $height ] ) ) {
$resize = $this->to_optml_crop( $sizes2crop[ $width . $height ] );
} elseif ( isset( $crop ) ) {
} elseif ( $crop !== null ) {
$resize = $this->to_optml_crop( $crop );
}

Expand Down

0 comments on commit 2b14e7c

Please sign in to comment.