Title: Call a custom hook
Last modified: September 18, 2021

---

# Call a custom hook

 *  [vrejiudragos](https://wordpress.org/support/users/vrejiudragos/)
 * (@vrejiudragos)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/call-a-custom-hook/)
 * Hello,
 * I’m trying to send the form data as body parameters to an API, create a new post
   and insert the data into the said post.
 * Could you please provide details on how can I implement this? The form submit
   flow should be something among the lines: Insert post -> Redirect to new post-
   > Call custom hook and populate the newly created post with the API’s response.
 * Any insight will be highly appreciated!
 * With the best wishes,
    Dragos

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

 *  Plugin Contributor [mjhead](https://wordpress.org/support/users/mjhead/)
 * (@mjhead)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/call-a-custom-hook/#post-14886169)
 * Hi! Yes, really good case! You can do this by using only `Insert Post` and `Call
   custom hook` actions.
 * At first you need to setup insert post action with settings you need
 * Than add Call a hook action and callback for this hook. Redirect is beter to 
   setup right inside in the hook callback. Here is an example of action setup –
   [http://prntscr.com/1ssud7m](http://prntscr.com/1ssud7m) and here is an example
   of callback code with sample API request and redirect – [https://gist.github.com/MjHead/6771eaba3adfe250378b4408878e75c5](https://gist.github.com/MjHead/6771eaba3adfe250378b4408878e75c5)
 *  Thread Starter [vrejiudragos](https://wordpress.org/support/users/vrejiudragos/)
 * (@vrejiudragos)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/call-a-custom-hook/#post-15093122)
 * Hello Andrey [@mjhead](https://wordpress.org/support/users/mjhead/),
 * Thank you for your response! It was helpful and much appreciated.
 * I have one more question. How can I access the value of the Custom Content Type
   created via the form?
 * The inserted post id can be retrieved using `$request['inserted_post_id']`. How
   could I retrieve the id of the inserted CCT instead?
 * Also, where could I see each key of the $request array?
 * Once again, thank you!
 * Best regards,
    Dragos

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

The topic ‘Call a custom hook’ is closed to new replies.

 * ![](https://ps.w.org/jetformbuilder/assets/icon-256x256.png?rev=2998825)
 * [JetFormBuilder — Dynamic Blocks Form Builder](https://wordpress.org/plugins/jetformbuilder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetformbuilder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetformbuilder/)
 * [Active Topics](https://wordpress.org/support/plugin/jetformbuilder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetformbuilder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetformbuilder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [vrejiudragos](https://wordpress.org/support/users/vrejiudragos/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/call-a-custom-hook/#post-15093122)
 * Status: not resolved