nf_check_post
Function that checks to see if we are processing a submission.
Description
nf_check_post();
Usage
if ( !function_exists( 'nf_check_post' ) ) { require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/form/display-form.php'; } // NOTICE! Understand what this does before running. $result = nf_check_post();
Defined (1)
The function is defined in the following location(s).
- /deprecated/includes/display/form/display-form.php
- function nf_check_post() {
- if( isset ( $_POST['_ninja_forms_display_submit'] ) AND absint ( $_POST['_ninja_forms_display_submit'] ) == 1 ) {
- /**
- * Nonces don't really secure anything from non-logged in users.
- * Using them for those users, however, can cause other issues.
- * Because of this, we are removing the nonce check for now.
- *
- * In 3.0, we need to look at creating our own system.
- */
- /**
- // If our nonce isn't set, bail
- if ( !isset ( $_POST['_wpnonce'] ) )
- return false;
- // If our nonce doesn't validate, bail
- if ( ! wp_verify_nonce( $_POST['_wpnonce'], 'nf_form_' . absint( $_POST['_form_id'] ) ) )
- return false;
- */
- $ajax = Ninja_Forms()->form( absint( $_POST['_form_id'] ) )->get_setting( 'ajax' );
- if( $ajax != 1 ) {
- add_action( 'init', 'ninja_forms_setup_processing_class', 5 );
- add_action( 'init', 'ninja_forms_pre_process', 999 );
- }else if( $ajax == 1 AND $_REQUEST['action'] == 'ninja_forms_ajax_submit' ) {
- add_action( 'init', 'ninja_forms_setup_processing_class', 5 );
- add_action( 'init', 'ninja_forms_pre_process', 999 );
- }
- }
- }