📜  删除 woo commerce 上的产品缩放 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:40.637000             🧑  作者: Mango

代码示例1
/**
 * Remove Zoom Effect on WooCommerce Product Image ( put in functions.php file of theme)
 *
 * @param $html, $post_id 
 *
 * @return $function 
 */

function njengah_remove_zoom_effect_product_image( $html, $post_id ) {
    
    $post_thumbnail_id = get_post_thumbnail_id( $post_id );
    return get_the_post_thumbnail( $post_thumbnail_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
}
add_filter('woocommerce_single_product_image_thumbnail_html', 'njengah_remove_zoom_effect_product_image', 10, 2);