我已经开始学习如何使用WooCommerce创建模板,我遇到了一个小问题.例如,在Woocommerce插件的php文件content-single-product.php中,我有这样的字符串:
<?php
/**
* woocommerce_single_product_summary hook.
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' );
?>
Run Code Online (Sandbox Code Playgroud)
例如,当我想编辑它(删除一些字段并更改结构)时,我尝试删除字符串:
do_action('woocommerce_single_product_summary');
之后写这样:
<?php
/**
* woocommerce_single_product_summary hook.
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - …
Run Code Online (Sandbox Code Playgroud)