woocommerce_single_product_image_thumbnail_html
Filter product image thumbnail HTML string.
Usage
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'wp_kama_woocommerce_single_product_image_thumbnail_html_filter', 10, 2 ); /** * Function for `woocommerce_single_product_image_thumbnail_html` filter-hook. * * @param string $html Product image thumbnail HTML string. * @param int $attachment_id Attachment ID. * * @return string */ function wp_kama_woocommerce_single_product_image_thumbnail_html_filter( $html, $attachment_id ){ // filter... return $html; }
- $html(string)
- Product image thumbnail HTML string.
- $attachment_id(int)
- Attachment ID.
Changelog
Since 1.6.4 | Introduced. |
Where the hook is called
woocommerce_single_product_image_thumbnail_html
woocommerce/templates/single-product/product-thumbnails.php 39
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', wc_get_gallery_image_html( $attachment_id, false, $key ), $attachment_id ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped
woocommerce/templates/single-product/product-image.php 55
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $post_thumbnail_id ); // phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped