Title: Custom Filter and Action functions
Last modified: April 22, 2023

---

# Custom Filter and Action functions

 *  Resolved [ilan76](https://wordpress.org/support/users/ilan76/)
 * (@ilan76)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-and-action-function/)
 * Hi,
 * I added 2 custom functions:
 * add_filter(‘forminator_custom_form_submit_errors’, ‘my_errors’, 10, 3);
 * add_action( ‘forminator_form_after_save_entry’, ‘my_action’, 10, 1);
 * The filter adds and display my custom errors fine but it appears that it’s still
   continue to process the from with my_action function, even though an error is
   displayed, after my_errors() function
 * Doesn’t the form process die if my_errors() function display an error message?
 * I want my custom errors messages to be displayed with my_errors() and not continue
   to process my_action() if it does.

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

 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-and-action-function/#post-16678094)
 * Hi [@ilan76](https://wordpress.org/support/users/ilan76/)
 * I hope you are doing well.
 * Based on Hook description:
 *     ```
       /**
        * Action called after form ajax
        *
        * @since 1.0.2
        *
        * @param int $form_id - the form id.
        * @param array $response - the post response.
        */
       ```
   
 * it is called after Ajax, so you will need to use $response to validate which 
   is the response status to prevent your custom code from keep going.
 * For example
 *     ```
       if ( ! $response['success'] ) {
          return;
       }
       ... rest of code.
       ```
   
 * In case it doesn’t help please upload the full code to [https://gist.github.com/](https://gist.github.com/)
   so we can take a deeper look.
 * Best Regards
    Patrick Freitas
 *  Thread Starter [ilan76](https://wordpress.org/support/users/ilan76/)
 * (@ilan76)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-and-action-function/#post-16679198)
 * Thanks, seems to work!

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

The topic ‘Custom Filter and Action functions’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ilan76](https://wordpress.org/support/users/ilan76/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/custom-filter-and-action-function/#post-16679198)
 * Status: resolved