Title: Call custom script/shortcode after submission
Last modified: December 5, 2018

---

# Call custom script/shortcode after submission

 *  Resolved [soulwasted](https://wordpress.org/support/users/soulwasted/)
 * (@soulwasted)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/call-custom-script-shortcode-after-submission/)
 * Hi.
 * I need to call custom script/shortcode after submission is completed.
    The best
   way for me is when success message is displayed.
 * In my case.
    — When new submission is made, it has it’s own unique ID. — I need
   to generate PDF with information from this submission. — I think that best place
   is “success message” where I have all ERF variables from ERF form.
 * Or do you have some API for callback when submission is made?
 * Thank you!
    pepę

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

 *  Plugin Author [easyregistrationforms](https://wordpress.org/support/users/easyregistrationforms/)
 * (@easyregistrationforms)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/call-custom-script-shortcode-after-submission/#post-10951791)
 * Hi [@soulwasted](https://wordpress.org/support/users/soulwasted/),
 * You can use one of our action : erf_post_submission
    Registered function will
   get one parameter with submission information. Let me know if it doesn’t work
   for you.
 *  Thread Starter [soulwasted](https://wordpress.org/support/users/soulwasted/)
 * (@soulwasted)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/call-custom-script-shortcode-after-submission/#post-10952243)
 * Ouukey…
    But how to use it? **I mean how to exactly call my function when just
   registration is made? Let’s say form#1.** I don’t want to call my function when
   using another ERF form to make custom posts and to edit them. form#2
 *  Plugin Author [easyregistrationforms](https://wordpress.org/support/users/easyregistrationforms/)
 * (@easyregistrationforms)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/call-custom-script-shortcode-after-submission/#post-10953317)
 * Hi,
 * You can add the it in your theme’s functions.php. Here is the sample code:
 * add_action(‘erf_post_submission’,’after_submission’);
    function after_submission(
   $submission){ if($submission[‘form_id’]==4){ // Compare your form ID } }
 * Let me know if you have any more questions.

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

The topic ‘Call custom script/shortcode after submission’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-registration-forms_82b2df.svg)
 * [Easy Registration Forms](https://wordpress.org/plugins/easy-registration-forms/)
 * [Support Threads](https://wordpress.org/support/plugin/easy-registration-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-registration-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-registration-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-registration-forms/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [easyregistrationforms](https://wordpress.org/support/users/easyregistrationforms/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/call-custom-script-shortcode-after-submission/#post-10953317)
 * Status: resolved