ninja_forms_field_timed_submit_pre_process

The Ninja Forms ninja forms field timed submit pre process function.

Description

ninja_forms_field_timed_submit_pre_process( $field_id, $user_value ); 

Parameters (2)

0. $field_id
The field id.
1. $user_value
The user value.

Usage

  1. if ( !function_exists( 'ninja_forms_field_timed_submit_pre_process' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/timed-submit.php'; 
  3.  
  4. // The field id. 
  5. $field_id = null; 
  6.  
  7. // The user value. 
  8. $user_value = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_field_timed_submit_pre_process($field_id, $user_value); 
  12.  

Defined (1)

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

/deprecated/includes/fields/timed-submit.php  
  1. function ninja_forms_field_timed_submit_pre_process( $field_id, $user_value ) { 
  2. global $ninja_forms_processing; 
  3.  
  4. $plugin_settings = nf_get_settings(); 
  5. if ( isset ( $plugin_settings['timed_submit_error'] ) ) { 
  6. $timed_submit_error = __( $plugin_settings['timed_submit_error'], 'ninja-forms' ); 
  7. } else { 
  8. $timed_submit_error = __('If you are a human, please slow down.', 'ninja-forms'); 
  9.  
  10. if ( isset ( $plugin_settings['javascript_error'] ) ) { 
  11. $javascript_error = __( $plugin_settings['javascript_error'], 'ninja-forms' ); 
  12. } else { 
  13. $javascript_error = __( 'You need JavaScript to submit this form. Please enable it and try again.', 'ninja-forms' ); 
  14.  
  15. if ( isset ( $user_value['no-js'] ) ) { 
  16. $ninja_forms_processing->add_error('javascript-general', $javascript_error, 'general' ); 
  17. } else { 
  18. $timer = isset( $user_value['timer'] ) ? $user_value['timer'] : 10; 
  19. if( intval( $timer ) > 0 ) { 
  20. $ninja_forms_processing->add_error('timer-'.$field_id, $timed_submit_error, $field_id); 
  21.  
  22.  
  23.