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-image.php 88
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $first_media_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
woocommerce/templates/single-product/product-thumbnails.php 72
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped