# How to call a custom php function if the form is submitted successfully?

**URL:** <https://forum.pinegrow.com/t/how-to-call-a-custom-php-function-if-the-form-is-submitted-successfully/5974>\
**Category:** Pinegrow Theme Converter\
**Tags:** tutorial\
**Created:** [December 1, 2021, 3:05am UTC](https://forum.pinegrow.com/t/how-to-call-a-custom-php-function-if-the-form-is-submitted-successfully/5974 "2021-12-01T03:05:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Catative](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/catative/32/4019_2.png) [@Catative](https://forum.pinegrow.com/u/Catative)\
**Post date:** [December 1, 2021, 3:05am UTC](https://forum.pinegrow.com/t/how-to-call-a-custom-php-function-if-the-form-is-submitted-successfully/5974/1 "2021-12-01T03:05:28Z")

</div>

Hello.

My question is related to the section of the [documentation about using a Form Action](https://pinegrow.com/docs/wordpress/actions/form/). In the section **CALL FUNCTION** it is written:

> The name of the function to call when the form is submitted successfully. Data is passed as the first argument, stored in the array. Form options array is passed in the second argument. The functions should return true on success and false on failure.
> 
> For example, set the Call function to process\_my\_form if the function is defines as:
> 
> ```auto
> function process_my_form($data, $options) {
> //do some cool things with the submitted data
> return true; //all good
> }
> 
> ```

Where in the graphical interface of Pinegrow Theme Converter should I insert the name of a custom php function to call it upon successful form submission? Is it possible to call a php function on condition if there was an error while submitting the form?

In the program interface, I did not find a field for specifying the name of a custom php function:

 ![333](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/2/2f588fa1549a1d0c0d84609020a42394f1059bfe.png)

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [December 1, 2021, 7:10pm UTC](https://forum.pinegrow.com/t/how-to-call-a-custom-php-function-if-the-form-is-submitted-successfully/5974/2 "2021-12-01T19:10:03Z")

</div>

Hi @Catative,  
Sorry, the documentation should be more clear that this feature is only available at this point in time with the Pinegrow Pro WordPress builder. In the theme converter this functionality has to be added by hand. The only difficulty is that Pinegrow will overwrite any customization added by a code editor, so, this type of modification can only be made when you have finished the conversion.  
Cheers,  
Bob

---

<div class="post-metadata">

**Author:** ![Catative](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/catative/32/4019_2.png) [@Catative](https://forum.pinegrow.com/u/Catative)\
**Post date:** [December 2, 2021, 7:29am UTC](https://forum.pinegrow.com/t/how-to-call-a-custom-php-function-if-the-form-is-submitted-successfully/5974/3 "2021-12-02T07:29:35Z")

</div>

Thank you for your reply, @RobM. I hope that in the next releases of Pinegrow Theme Converter this missing functionality will be added.
