Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * JKIT || Example Output Filter of WooCommerce Product Images
- *
- * Add Caption to Product Images
- *
- * @param string $html Rendered HTML.
- * @param WC_Product $class Class of WC_Product.
- * @param string $size (default: 'woocommerce_thumbnail').
- * @param array $attr Image attributes.
- * @param bool $placeholder True to return $placeholder if no image is found, or false to return an empty string.
- * @param string $image Rendered Image HTML.
- *
- * @return string
- */
- function add_caption_to_product_images( $html, $class, $size, $attr, $placeholder, $image ) {
- $html .= '<h6>Custom Caption</h6>';
- return $html;
- }
- add_filter( 'woocommerce_product_get_image', 'add_caption_to_product_images', 10, 6 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement