I'm using Ninja Forms and their extension to do front-end posts. They have a function that isn't working that is supposed to allow you to redirect to a specific "thank you" page depending on values from the form (you specify the form field ID). This is the code but it isn't working:
function change_ninja_forms_landing_page(){
global $ninja_forms_processing;
$form_id = $ninja_forms_processing->get_form_ID();
if( $form_id == 1 ){
$swapcategory = $ninja_forms_processing->get_field_value( 21 );
switch( $swapcategory ){
case 'Need':
$url = 'http://dcartistexchange.org/start-swapping/need/';
break;
case 'Offer':
$url = 'http://dcartistexchange.org/start-swapping/offers/';
break;
}
// $url now contains our new success page. Let's update the form setting.
$ninja_forms_processing->update_form_setting( 'landing_page', $url );
}
}
Field 21 is a custom post type category checkbox and the "case" are the field values. When I submit the form, nothing happens (I get the form submitted confirmation but it doesn't go to the pages specified).
I've tried putting wp_redirect in there (with the exit) and that doesn't seem to work either. Can anyone see what I may be missing?