woocommerce "publish ""product"" webhook

I want to add an action whenever the admin publishes a product, but the WP hook publish_post does not trigger then - eve

I want to add an action whenever the admin publishes a product, but the WP hook publish_post does not trigger then - even though a wc product is just another type of post.

I haven't found a woocommerce hook that triggers when a product is published.

Any thoughts?

I want to add an action whenever the admin publishes a product, but the WP hook publish_post does not trigger then - even though a wc product is just another type of post.

I haven't found a woocommerce hook that triggers when a product is published.

Any thoughts?

Share Improve this question asked Jan 29, 2020 at 22:33 Farmer MoFarmer Mo 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 4

The action hook publish_post doesn't work for custom post types. You need to use the following format: publish_{$custom_post_type}

As you are using Woocommerce this post type is product so you want to use: publish_product.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744790846a4593905.html

相关推荐

  • woocommerce "publish ""product"" webhook

    I want to add an action whenever the admin publishes a product, but the WP hook publish_post does not trigger then - eve

    10小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信