ninja_forms_field_timed_submit_display

The Ninja Forms ninja forms field timed submit display function.

Description

ninja_forms_field_timed_submit_display( $field_id, $data, (string) $form_id = '' ); 

Parameters (3)

0. $field_id
The field id.
1. $data
The data.
2. $form_id — Optional. (string) => ''
The form id.

Usage

  1. if ( !function_exists( 'ninja_forms_field_timed_submit_display' ) ) { 
  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 data. 
  8. $data = null; 
  9.  
  10. // The form id. 
  11. $form_id = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = ninja_forms_field_timed_submit_display($field_id, $data, $form_id); 
  15.  

Defined (1)

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

/deprecated/includes/fields/timed-submit.php  
  1. function ninja_forms_field_timed_submit_display( $field_id, $data, $form_id = '' ) { 
  2.  
  3. $field_class = ninja_forms_get_field_class( $field_id, $form_id ); 
  4.  
  5. if(isset($data['timer-text']) AND $data['timer-text'] != '') { 
  6. $label = $data['timer-text']; 
  7. }else{ 
  8. $label = __( 'Please wait %n seconds', 'ninja-forms' ); 
  9.  
  10. if(isset($data['countdown']) AND $data['countdown'] != '') { 
  11. $countdown = $data['countdown']; 
  12. }else{ 
  13. $countdown = '10'; 
  14.  
  15. if(isset($data['label']) AND $data['label'] != '') { 
  16. $submit_text = $data['label']; 
  17. }else{ 
  18. $submit_text = __( 'Submit', 'ninja-forms' ); 
  19.  
  20. $label = preg_replace( "/%n/", "<span>" . $countdown . "</span>", $label); 
  21. ?> 
  22.  
  23. <input id="ninja_forms_field_<?php echo $field_id;?>_js" name="ninja_forms_field_<?php echo $field_id;?>[no-js]" type="hidden" value="1" rel="<?php echo $field_id;?>_js" class="no-js" /> 
  24.  
  25. <button type="submit" name="ninja_forms_field_<?php echo $field_id;?>[timer]" class="<?php echo $field_class;?> countdown-timer" id="ninja_forms_field_<?php echo $field_id;?>" value="<?php echo $countdown;?>" rel="<?php echo $field_id;?>" data-countdown="<?php echo $countdown;?>" data-text="<?php esc_attr_e( $submit_text );?>"><?php echo $label ;?></button> 
  26.  
  27. <?php 
  28.