Height must be int

This commit is contained in:
Mike Jolley 2018-02-09 14:12:19 +00:00
parent 9d898bbf6e
commit 7339511495
1 changed files with 2 additions and 2 deletions

View File

@ -744,13 +744,13 @@ function wc_get_image_size( $image_size ) {
} elseif ( 'custom' === $cropping ) {
$width = max( 1, get_option( 'woocommerce_thumbnail_cropping_custom_width', '4' ) );
$height = max( 1, get_option( 'woocommerce_thumbnail_cropping_custom_height', '3' ) );
$size['height'] = round( ( $size['width'] / $width ) * $height );
$size['height'] = absint( round( ( $size['width'] / $width ) * $height ) );
$size['crop'] = 1;
} else {
$cropping_split = explode( ':', $cropping );
$width = max( 1, current( $cropping_split ) );
$height = max( 1, end( $cropping_split ) );
$size['height'] = round( ( $size['width'] / $width ) * $height );
$size['height'] = absint( round( ( $size['width'] / $width ) * $height ) );
$size['crop'] = 1;
}
$image_size = 'thumbnail';