woocommerce_gallery_image_size
Filters the product gallery image size.
Usage
add_filter( 'woocommerce_gallery_image_size', 'wp_kama_woocommerce_gallery_image_size_filter' );
/**
* Function for `woocommerce_gallery_image_size` filter-hook.
*
* @param string|array $size Image size.
*
* @return string|array
*/
function wp_kama_woocommerce_gallery_image_size_filter( $size ){
// filter...
return $size;
}
- $size(string|array)
- Image size.
Changelog
| Since 3.3.2 | Introduced. |
Where the hook is called
woocommerce_gallery_image_size
woocommerce_gallery_image_size
woocommerce_gallery_image_size
woocommerce/src/Internal/ProductGallery/ProductMediaGallery.php 388-391
$image_size = apply_filters( 'woocommerce_gallery_image_size', $flexslider || $main_video ? 'woocommerce_single' : $thumbnail_size );
woocommerce/includes/wc-product-functions.php 1347
$image_size = apply_filters( 'woocommerce_gallery_image_size', 'woocommerce_single' );
woocommerce/includes/wc-template-functions.php 1832
$image_size = apply_filters( 'woocommerce_gallery_image_size', $flexslider || $main_image ? 'woocommerce_single' : $thumbnail_size );