nf_check_post

Function that checks to see if we are processing a submission.

Description

nf_check_post(); 

Usage

  1. if ( !function_exists( 'nf_check_post' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/form/display-form.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = nf_check_post(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/display/form/display-form.php  
  1. function nf_check_post() { 
  2. if( isset ( $_POST['_ninja_forms_display_submit'] ) AND absint ( $_POST['_ninja_forms_display_submit'] ) == 1 ) { 
  3. /** 
  4. * Nonces don't really secure anything from non-logged in users. 
  5. * Using them for those users, however, can cause other issues. 
  6. * Because of this, we are removing the nonce check for now. 
  7. *  
  8. * In 3.0, we need to look at creating our own system. 
  9. */ 
  10. /** 
  11. // If our nonce isn't set, bail 
  12. if ( !isset ( $_POST['_wpnonce'] ) ) 
  13. return false; 
  14.   
  15. // If our nonce doesn't validate, bail 
  16. if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'nf_form_' . absint( $_POST['_form_id'] ) ) ) 
  17. return false; 
  18. */ 
  19. $ajax = Ninja_Forms()->form( absint( $_POST['_form_id'] ) )->get_setting( 'ajax' ); 
  20.  
  21. if( $ajax != 1 ) { 
  22. add_action( 'init', 'ninja_forms_pre_process', 999 ); 
  23. }else if( $ajax == 1 AND $_REQUEST['action'] == 'ninja_forms_ajax_submit' ) { 
  24. add_action( 'init', 'ninja_forms_pre_process', 999 );