/deprecated/includes/display/processing/fields-process.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2. add_action('init', 'ninja_forms_register_fields_process'); 
  3. function ninja_forms_register_fields_process() { 
  4. add_action('ninja_forms_process', 'ninja_forms_fields_process'); 
  5.  
  6. function ninja_forms_fields_process( $form_id ) { 
  7. global $ninja_forms_fields, $ninja_forms_processing; 
  8. //Loop through the submitted form data and call each field's processing function, if one exists. 
  9. $form_id = $ninja_forms_processing->get_form_ID(); 
  10. $field_results = $ninja_forms_processing->get_all_fields(); 
  11. if( is_array( $field_results ) AND !empty( $field_results ) ) { 
  12. foreach( $field_results as $field_id => $user_value ) { 
  13. $field = $ninja_forms_processing->get_field_settings( $field_id ); 
  14. $field_id = $field['id']; 
  15. $field_type = $field['type']; 
  16. $field_data = $field['data']; 
  17. if( isset( $ninja_forms_fields[$field_type] ) ) { 
  18. $reg_field = $ninja_forms_fields[$field_type]; 
  19. //if( $reg_field['process_field'] ) { 
  20. $process_function = $reg_field['process']; 
  21. if($process_function != '') { 
  22. $arguments = array(); 
  23. $arguments['field_id'] = $field_id; 
  24. $user_value = apply_filters( 'ninja_forms_field_process_user_value', $user_value, $field_id ); 
  25. $arguments['user_value'] = $user_value; 
  26. call_user_func_array($process_function, $arguments); 
  27. //} 
.