【发布时间】:2021-06-03 20:30:02
【问题描述】:
我尝试通过添加以下代码来阻止 WooCommerce 上的可点击图像事件。它工作正常,但添加后,在单个产品页面中,它会在图像上方显示一个文本(在本例中为“打开”)。我该如何解决这个问题?
function e12_remove_product_image_link( $html, $post_id ) {
return preg_replace( "!<(a|/a).*?>!", '', $html );
}
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'e12_remove_product_image_link', 10, 2 );
【问题讨论】:
标签: php css woocommerce