Skip to content

Instantly share code, notes, and snippets.

@UVLabs
Created July 24, 2020 14:21
Show Gist options
  • Save UVLabs/35e358f75adba09dc337bb92edeab7e8 to your computer and use it in GitHub Desktop.
Save UVLabs/35e358f75adba09dc337bb92edeab7e8 to your computer and use it in GitHub Desktop.
Change/filter the Ninja Forms redirect hook
<?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'] . "&param=" . $my_variable;
return $action_settings;
}
add_filter( 'ninja_forms_run_action_settings', 'nf_filter_redirect_url', 10, 4 );
@V0x42
Copy link

V0x42 commented Aug 8, 2024

Hey, thank you for this!
Just a little note, it works but in line 5 it should be "!=" instead of "!=="

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment