【发布时间】:2022-08-15 23:31:57
【问题描述】:
我想在我的 woocommerce 单品页面上添加一个下载按钮。单击此按钮后,我需要下载该产品的所有图像。我得到一个下载单个图像的代码。但我需要下载所有图像。
add_action(\'woocommerce_product_meta_end\',\'disclaimer\');
function disclaimer(){
echo \'<br /><br /><a href=\"\'.wp_get_attachment_url( get_post_thumbnail_id() ).\'\" class=\"single_add_to_cart_button button
alt\">Download</a><p id=\"disclaimer-text\"><br /><br />*Color Disclaimer:
Due to the limitations of desktop scanners and the relative
inconsistencies of various display monitors, the colors you see on your
screen may not be a totally accurate reproduction of the actual product.
We strive to make our colors as accurate as possible, but screen images
are intended as a guide only and should not be regarded as absolutely
correct. If you would like to see a sample of any product shown on our
site, please call Customer Service at 6365 3383 or visit our contact
page.</p>\';
}
标签: woocommerce