ninja_forms_setup_processing_class

The Ninja Forms ninja forms setup processing class function.

Description

ninja_forms_setup_processing_class( (string) $form_id = '' ); 

Parameters (1)

0. $form_id — Optional. (string) => ''
The form id.

Usage

  1. if ( !function_exists( 'ninja_forms_setup_processing_class' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/processing/pre-process.php'; 
  3.  
  4. // The form id. 
  5. $form_id = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ninja_forms_setup_processing_class($form_id); 
  9.  

Defined (1)

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

/deprecated/includes/display/processing/pre-process.php  
  1. function ninja_forms_setup_processing_class( $form_id = '' ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. $session_reflection = new ReflectionMethod( 'WP_Session', 'set_cookie' ); 
  5. if( $session_reflection->isPublic() ) { 
  6. // Manually set the cookie. 
  7. Ninja_Forms()->session->init()->set_cookie(); 
  8.  
  9. $cache = Ninja_Forms()->session->get( 'nf_cache' ); 
  10. //Set the form id 
  11. if ( $form_id == '' ) { 
  12. if ( isset ( $_REQUEST['_form_id'] ) ) { 
  13. $form_id = absint( $_REQUEST['_form_id'] ); 
  14. } else if ( $cache ) { 
  15. $form_id = $cache['form_id']; 
  16.  
  17. //Initiate our processing class with our designated global variable. 
  18. $ninja_forms_processing = new Ninja_Forms_Processing($form_id); 
  19. $ninja_forms_processing->setup_submitted_vars();