Created
July 24, 2020 14:21
-
-
Save UVLabs/35e358f75adba09dc337bb92edeab7e8 to your computer and use it in GitHub Desktop.
Change/filter the Ninja Forms redirect hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function nf_filter_redirect_url( $action_settings, $form_id, $action_id, $form_settings ) { | |
if( $form_id !== <id> ){ | |
return $action_settings; | |
} | |
// more conditions can be added as needed | |
// doc: https://developer.ninjaforms.com/codex/submission-processing-hooks/ | |
$my_variable = 'something'; | |
$action_settings['redirect_url'] = $action_settings['redirect_url'] . "¶m=" . $my_variable; | |
return $action_settings; | |
} | |
add_filter( 'ninja_forms_run_action_settings', 'nf_filter_redirect_url', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thank you for this!
Just a little note, it works but in line 5 it should be "!=" instead of "!=="