ninja_forms_field_text_display

The Ninja Forms ninja forms field text display function.

Description

ninja_forms_field_text_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_text_display' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/textbox.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_text_display($field_id, $data, $form_id); 
  15.  

Defined (1)

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

/deprecated/includes/fields/textbox.php  
  1. function ninja_forms_field_text_display( $field_id, $data, $form_id = '' ) { 
  2. global $current_user; 
  3. $field_class = ninja_forms_get_field_class( $field_id, $form_id ); 
  4.  
  5. if ( isset( $data['email'] ) && $data['email'] == 1 ) { 
  6. $field_class .= ' email'; 
  7.  
  8. if(isset($data['default_value'])) { 
  9. $default_value = $data['default_value']; 
  10. }else{ 
  11. $default_value = ''; 
  12.  
  13. if(isset($data['label_pos'])) { 
  14. $label_pos = $data['label_pos']; 
  15. }else{ 
  16. $label_pos = "left"; 
  17.  
  18. if(isset($data['label'])) { 
  19. $label = $data['label']; 
  20. }else{ 
  21. $label = ''; 
  22.  
  23. if( isset( $data['mask'] ) ) { 
  24. $mask = $data['mask']; 
  25. }else{ 
  26. $mask = ''; 
  27. }  
  28.  
  29. if( isset( $data['input_limit'] ) ) { 
  30. $input_limit = $data['input_limit']; 
  31. }else{ 
  32. $input_limit = ''; 
  33.  
  34. if( isset( $data['input_limit_type'] ) ) { 
  35. $input_limit_type = $data['input_limit_type']; 
  36. }else{ 
  37. $input_limit_type = ''; 
  38.  
  39. if( isset( $data['input_limit_msg'] ) ) { 
  40. $input_limit_msg = $data['input_limit_msg']; 
  41. }else{ 
  42. $input_limit_msg = ''; 
  43.  
  44. $autocomplete_off = isset ( $data['autocomplete_off'] ) ? $data['autocomplete_off'] : 0; 
  45.  
  46. if ( 1 == $autocomplete_off ) { 
  47. $autocomplete_off = 'autocomplete="off"'; 
  48. } else { 
  49. $autocomplete_off = ''; 
  50.  
  51. switch( $mask ) { 
  52. case '': 
  53. $mask_class = ''; 
  54. break; 
  55. case 'date': 
  56. $mask_class = 'ninja-forms-date'; 
  57. break; 
  58. case 'currency': 
  59. $mask_class = 'ninja-forms-currency'; 
  60. break; 
  61. default: 
  62. $mask_class = 'ninja-forms-mask'; 
  63. break; 
  64.  
  65. if( isset( $data['datepicker'] ) AND $data['datepicker'] == 1 ) { 
  66. $mask_class = 'ninja-forms-datepicker'; 
  67.  
  68. $disable_input = isset( $data['disable_input'] ) ? $data['disable_input'] : 0; 
  69.  
  70. if ( 1 == $disable_input ) { 
  71. $disabled = 'disabled'; 
  72. } else { 
  73. $disabled = ''; 
  74.  
  75. $placeholder = isset ( $data['placeholder'] ) ? $data['placeholder'] : ''; 
  76.  
  77. ?> 
  78. <input id="ninja_forms_field_<?php echo $field_id;?>" data-mask="<?php echo $mask;?>" data-input-limit="<?php echo $input_limit;?>" data-input-limit-type="<?php echo $input_limit_type;?>" data-input-limit-msg="<?php echo $input_limit_msg;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="text" placeholder="<?php echo $placeholder;?>" class="<?php echo $field_class;?> <?php echo $mask_class;?>" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" <?php echo $disabled; ?> <?php echo $autocomplete_off; ?> /> 
  79. <?php 
  80.