CCCPaste

JKIT || Example Output Filter of WooCommerce Product Images

/**
 * 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 .= '
Custom Caption
'; return $html; } add_filter( 'woocommerce_product_get_image', 'add_caption_to_product_images', 10, 6 );