Troubleshooting //
How to Use the Redirect Action Hook in JetEngine Forms

How to Use the Redirect Action Hook in JetEngine Forms

Question

I’m not sure how to use the Call a Hook functionality to redirect a user to a certain page

Answer

Hooks can be called “actions” in other words. You create an action using HTML code and insert it into your theme’s functions.php file. Upon the Form submission, if the hook inserted into a corresponding field matches the code in functions.php, the action is performed.

Let’s consider the following example:

call a hook notification type settings


Here is the hook where “redirect” is the Hook name, and you can insert your own one based on the tips below this field.

After that, this code should be inserted into functions.php of your active theme:

add_action( 'jet-engine-booking/redirect', function() {
   wp_redirect( 'https://wordpress.org/' );
    exit;
}
);

Go to Appearance > Theme Editor and press the Theme Functions (functions.php) tab in the right-side section. Scroll down the theme contents a bit and paste the code in there. Then update the file.

functions.php editing and code input


This hook means that upon form completion you will be redirected to https://wordpress.org/.

The Call a Hook functionality requires developer skills and knowledge in order to create the necessary actions. You can learn more from here: https://developer.wordpress.org/plugins/hooks/.

Was this article helpful?
YesNo
Still need help?
Submit a request