Title: New Custom Post Type Trigger
Last modified: April 22, 2021

---

# New Custom Post Type Trigger

 *  Resolved [iananderson](https://wordpress.org/support/users/iananderson/)
 * (@iananderson)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/new-custom-post-type-trigger/)
 * Hi,
    I’m using the free version of WP Webhooks, but struggling to understand 
   the docs. I want to fire a webhook when a new Custom Post Type is added. Do I
   use the trigger “Send Data On New Post” and if so – how to I choose the CPT I
   want? Or do I chose the trigger “Send Data On Custom Action”? I have the url 
   of the webhook, but I just don’t know how or where to fire the trigger. It says“
   You can fire the trigger wherever you want within your PHP code.” Does that mean
   I add some code to my functions.php file? And if so, what code do I add? Does
   it need to be inside a function or do I simply add it to my functions.php file.
   Sorry for my basic understanding. Thanks for your help Ian

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Ironikus](https://wordpress.org/support/users/ironikus/)
 * (@ironikus)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/new-custom-post-type-trigger/#post-14351271)
 * Hey [@iananderson](https://wordpress.org/support/users/iananderson/) – Thank 
   you very much for reaching out, as well as for using our plugin.
    Just to clarify
   one thing: Do you really want to fire a trigger once a new post type is added,
   or only once a new post for a custom post type is added? Depending on that, I
   can give you further advice on that.
 * In general, the “Send Data On Custom Action” code example can be included anywhere.
   It’s just a question of when you want to fire it. If you include it directly 
   into your functions.php file, it will cause the trigger to fire with every call
   of your WordPress site, regardless of backend or frontend.
 * To only fire it on certain events, I suggest finding an adequate hook that links
   to your action you want to fire the trigger on. Within the callback, you can 
   then add the code.
 * If you have any further questions in the meantime, feel free to let me know. 
   🙂
 *  Thread Starter [iananderson](https://wordpress.org/support/users/iananderson/)
 * (@iananderson)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/new-custom-post-type-trigger/#post-14353983)
 * Thanks for your reply.
 * I would like to fire the webhook when a new post is added for a custom post type.
 * Sorry for my lack of knowledge. Does the hook need to be specific to the custom
   post type? How would I know what the hook is?
 * Thanks again,
 * Ian
 *  Plugin Contributor [Ironikus](https://wordpress.org/support/users/ironikus/)
 * (@ironikus)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/new-custom-post-type-trigger/#post-14355911)
 * Hey [@iananderson](https://wordpress.org/support/users/iananderson/) – Thank 
   you very much for your answer and the additional details.
    You know what hook
   it is based on where you want to send the data to. If you want to send the data,
   e.g. to Integromat or Pabbly, you will receive there within their app a webhook
   URL that can receive data. This URL is what you then add within the “**Send Data**”
   tab of our plugin to the “**Send Data on New Post**” webhook.
 * Once it’s there, you will find a little settings link next to the added URL –
   there you have further features on controlling what data you really want to send
   over.
    Feel free to take a look at it via the web view of our plugin here: [https://wp-webhooks.com/free/send-data/?&wpwh-trigger=post_create#webhook-4](https://wp-webhooks.com/free/send-data/?&wpwh-trigger=post_create#webhook-4)
 * Do let me know in case you have any further questions. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘New Custom Post Type Trigger’ is closed to new replies.

 * ![](https://ps.w.org/wp-webhooks/assets/icon-256x256.jpg?rev=2656397)
 * [WP Webhooks - Automate repetitive tasks by creating powerful automation workflows directly within WordPress](https://wordpress.org/plugins/wp-webhooks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-webhooks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-webhooks/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-webhooks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-webhooks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-webhooks/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ironikus](https://wordpress.org/support/users/ironikus/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/new-custom-post-type-trigger/#post-14355911)
 * Status: resolved