1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
<?php function ninja_forms_post_process(){ global $wpdb, $ninja_forms_processing;
$ajax = $ninja_forms_processing->get_form_setting('ajax'); $form_id = $ninja_forms_processing->get_form_ID();
if(!$ninja_forms_processing->get_all_errors()){
do_action('ninja_forms_post_process');
if( !$ninja_forms_processing->get_all_errors() ){
$ninja_forms_processing->update_form_setting( 'processing_complete', 1 );
$json = ninja_forms_json_response(); if($ajax == 1){ //header('Content-Type', 'application/json'); echo $json; die(); }else{
if( $ninja_forms_processing->get_form_setting( 'landing_page' ) != '' ){ ninja_forms_set_transient(); wp_redirect( $ninja_forms_processing->get_form_setting( 'landing_page' ) ); die(); } } }else{ if($ajax == 1){ //header('Content-Type', 'application/json'); echo $json; die(); }else{ //echo 'post-processing'; //print_r($ninja_forms_processing->get_all_errors()); } } }else{ if($ajax == 1){ //header('Content-Type', 'application/json'); echo $json; die(); }else{ //echo 'post-processing'; //print_r($ninja_forms_processing->get_all_errors()); } } }
|