• Resolved ilan76

    (@ilan76)


    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

    (@wpmudevsupport12)

    Hi @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/ so we can take a deeper look.

    Best Regards
    Patrick Freitas

    Thread Starter ilan76

    (@ilan76)

    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.