ninja_forms_field_spam_display

The Ninja Forms ninja forms field spam display function.

Description

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

Defined (1)

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

/deprecated/includes/fields/spam.php  
  1. function ninja_forms_field_spam_display( $field_id, $data, $form_id = '' ) { 
  2. if(isset($data['default_value'])) { 
  3. $default_value = $data['default_value']; 
  4. }else{ 
  5. $default_value = ''; 
  6.  
  7. if(isset($data['show_field'])) { 
  8. $show_field = $data['show_field']; 
  9. }else{ 
  10. $show_field = true; 
  11.  
  12. $field_class = ninja_forms_get_field_class( $field_id, $form_id ); 
  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($label_pos == 'inside') { 
  24. $default_value = $label; 
  25.  
  26. ?> 
  27. <input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="text" class="<?php echo $field_class;?>" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" /> 
  28. <?php 
  29.