ninja_forms_field_spam_edit

The Ninja Forms ninja forms field spam edit function.

Description

ninja_forms_field_spam_edit( $field_id, $data ); 

Parameters (2)

0. $field_id
The field id.
1. $data
The data.

Usage

  1. if ( !function_exists( 'ninja_forms_field_spam_edit' ) ) { 
  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. // NOTICE! Understand what this does before running. 
  11. $result = ninja_forms_field_spam_edit($field_id, $data); 
  12.  

Defined (1)

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

/deprecated/includes/fields/spam.php  
  1. function ninja_forms_field_spam_edit( $field_id, $data ) { 
  2. if(isset($data['label'])) { 
  3. $question = $data['label']; 
  4. }else{ 
  5. $question = ''; 
  6.  
  7. if(isset($data['answer'])) { 
  8. $answer = $data['answer']; 
  9. }else{ 
  10. $answer = ''; 
  11. ?> 
  12. <input type="hidden" name="ninja_forms_field_<?php echo $field_id;?>[req]" value="1"> 
  13. <p class="description description-wide"> 
  14. <label for=""> 
  15. <?php _e( 'Spam Question' , 'ninja-forms'); ?><br /> 
  16. <input type="text" class="widefat code ninja-forms-field-label" name="ninja_forms_field_<?php echo $field_id;?>[label]" id="ninja_forms_field_<?php echo $field_id;?>_label" value="<?php echo stripslashes( $question );?>"> 
  17. </label> 
  18. </p> 
  19. <p class="description description-wide"> 
  20. <label for=""> 
  21. <?php _e( 'Spam Answer', 'ninja-forms'); ?><br /> 
  22. <input type="text" class="widefat" name="ninja_forms_field_<?php echo $field_id;?>[answer]" id="" value="<?php echo $answer;?>"> 
  23. </label> 
  24. </p> 
  25. <?php