加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 删除标题钩Woocommerce

发布时间:2020-12-13 22:27:43 所属栏目: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 * @hoo
在我的产品模板上,我执行此操作:

<?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');
?>

我想要的是删除woocommerce_template_single_title钩子,所以在我的functions.php文件中我编写了这段代码:

remove_action('woocommerce_single_product_summary','woocommerce_template_single_title',1);

但它不起作用,我不知道如何.

谢谢你的帮助

!编辑!!

没关系,我写下来解决了这个问题:

remove_action('woocommerce_single_product_summary',5);

优先级必须匹配

解决方法

The author has added the one-liner to his question; as suggested by @Bugs,here it is as an answer.

// Remove title hook Woocommerce
remove_action('woocommerce_single_product_summary',5);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读