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
.
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
.