context['postId'] ) && ! empty( $instance->context['query']['postType'] ) && 'product' === $instance->context['query']['postType']; if ( ! $is_inside_product_template ) { return $html; } $enable_product_image_hover_zoom = get_theme_mod( 'enable_product_image_hover_zoom', true ); if ( ! $enable_product_image_hover_zoom ) { return $html; } $tag = new \WP_HTML_Tag_Processor( $html ); if ( $tag->next_tag() ) { $tag->set_attribute( 'data-zoom-hover', 'true' ); $html = $tag->get_updated_html(); } return $html; } }