Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Click submit -> do stuff with form data -> redirect #35151
    wp_tc_questions
    Participant

    FWIW, I got the functionality I was trying to achieve, thanks.

    I went with configuring the confirmation redirect in the UI

    How do I set up the form to redirect to another page?

    Then in functions php, went with the quform_post_validate hook, and if I want to short circuit the redirect I can return an error.

    add_filter(‘quform_post_validate_1’, function (array $result, Quform_Form $form) {

    //do some stuff

    if(//stuff did not work) {
    $result = array(
    ‘type’ => ‘error’,
    ‘error’ => array(
    ‘enabled’ => true,
    ‘title’ => ”,
    ‘content’ => ‘It’s Broken.’
    )
    );
    }
    return $result;
    }, 10, 2);

Viewing 1 post (of 1 total)
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy