ninja_forms_field_hidden_edit

The Ninja Forms ninja forms field hidden edit function.

Description

ninja_forms_field_hidden_edit( $field_id, $data ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'ninja_forms_field_hidden_edit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/hidden.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_hidden_edit($field_id, $data); 
  12.  

Defined (1)

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

/deprecated/includes/fields/hidden.php  
  1. function ninja_forms_field_hidden_edit($field_id, $data) { 
  2. $custom = ''; 
  3. $currency_symbol = isset( $plugin_settings['currency_symbol'] ) ? $plugin_settings['currency_symbol'] : "$"; 
  4. $date_format = isset( $plugin_settings['date_format'] ) ? $plugin_settings['date_format'] : "m/d/Y"; 
  5. $default_value = isset( $data['default_value'] ) ? $data['default_value'] : ''; 
  6. $default_value_type = isset( $data['default_value_type'] ) ? $data['default_value_type'] : ''; 
  7. $custom = ''; 
  8.  
  9. if( $default_value == 'none' ) { 
  10. $default_value = ''; 
  11.  
  12. ?> 
  13. <p class="description description-thin"> 
  14. <label for=""> 
  15. <?php _e( 'Default Value' , 'ninja-forms'); ?><br /> 
  16. <select id="default_value_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>[default_value_type]" class="widefat ninja-forms-_text-default-value"> 
  17. <option value="" <?php if( $default_value == '') { echo 'selected'; $custom = 'no';}?>><?php _e('None', 'ninja-forms'); ?></option> 
  18. <option value="_user_id" <?php if($default_value == '_user_id') { echo 'selected'; $custom = 'no';}?>><?php _e('User ID (If logged in)', 'ninja-forms'); ?></option> 
  19. <option value="_user_firstname" <?php if($default_value == '_user_firstname') { echo 'selected'; $custom = 'no';}?>><?php _e('User Firstname (If logged in)', 'ninja-forms'); ?></option> 
  20. <option value="_user_lastname" <?php if($default_value == '_user_lastname') { echo 'selected'; $custom = 'no';}?>><?php _e('User Lastname (If logged in)', 'ninja-forms'); ?></option> 
  21. <option value="_user_display_name" <?php if($default_value == '_user_display_name') { echo 'selected'; $custom = 'no';}?>><?php _e('User Display Name (If logged in)', 'ninja-forms'); ?></option> 
  22. <option value="_user_email" <?php if($default_value == '_user_email') { echo 'selected'; $custom = 'no';}?>><?php _e('User Email (If logged in)', 'ninja-forms'); ?></option> 
  23. <option value="post_id" <?php if($default_value == 'post_id') { echo 'selected'; $custom = 'no';}?>><?php _e('Post / Page ID (If available)', 'ninja-forms'); ?></option> 
  24. <option value="post_title" <?php if($default_value == 'post_title') { echo 'selected'; $custom = 'no';}?>><?php _e('Post / Page Title (If available)', 'ninja-forms'); ?></option> 
  25. <option value="post_url" <?php if($default_value == 'post_url') { echo 'selected'; $custom = 'no';}?>><?php _e('Post / Page URL (If available)', 'ninja-forms'); ?></option> 
  26. <option value="today" <?php if($default_value == 'today') { echo 'selected'; $custom = 'no';}?>><?php _e('Today\'s Date', 'ninja-forms'); ?></option> 
  27. <option value="_custom" <?php if($custom != 'no') { echo 'selected';}?>><?php _e('Custom', 'ninja-forms'); ?> -></option> 
  28. <option value="querystring" <?php if($default_value_type == 'querystring') { echo 'selected'; $custom = 'yes';}?>><?php _e('Querystring Variable', 'ninja-forms'); ?> -></option> 
  29. </select> 
  30. </label> 
  31. </p> 
  32. <p class="description description-thin"> 
  33. <label for="" id="default_value_label_<?php echo $field_id;?>" style="<?php if($custom == 'no') { echo 'display:none;';}?>"> 
  34. <br /> 
  35. <input type="text" class="widefat code nf-default-value-text" name="ninja_forms_field_<?php echo $field_id;?>[default_value]" id="ninja_forms_field_<?php echo $field_id;?>_default_value" value="<?php echo $default_value;?>" data-field-id="<?php echo $field_id; ?>" /> 
  36. <span class="querystring-error" style="display:none;"><?php _e( 'This keyword is reserved by WordPress. Please try another.', 'ninja-forms' ); ?></span> 
  37. </label> 
  38. </p> 
  39.  
  40. <?php 
  41. // Email Input Box ? 
  42. if(isset($data['email'])) { 
  43. $email = $data['email']; 
  44. }else{ 
  45. $email = ''; 
  46.  
  47. if(isset($data['send_email'])) { 
  48. $send_email = $data['send_email']; 
  49. }else{ 
  50. $send_email = ''; 
  51. ?> 
  52. <p class="description description-thin"> 
  53. <label for="ninja_forms_field_<?php echo $field_id;?>_email"> 
  54. <?php _e( 'Is this an email address?' , 'ninja-forms'); ?> 
  55. <input type="hidden" value="0" name="ninja_forms_field_<?php echo $field_id;?>[email]"> 
  56. <input type="checkbox" value="1" name="ninja_forms_field_<?php echo $field_id;?>[email]" id="ninja_forms_field_<?php echo $field_id;?>_email" class="ninja-forms-hidden-email" <?php if($email == 1) { echo "checked";}?>> 
  57. </label> 
  58. <a href="#" class="tooltip"> 
  59. <img id="" class='ninja-forms-help-text' src="<?php echo NINJA_FORMS_URL;?>images/question-ico.gif" title=""> 
  60. <span> 
  61. <img class="callout" src="<?php echo NINJA_FORMS_URL;?>images/callout.gif" /> 
  62. <?php _e( 'If this box is checked, Ninja Forms will validate this input as an email address.', 'ninja-forms' );?> 
  63. </span> 
  64. </a> 
  65. </p> 
  66.  
  67. <p class="description description-wide"> 
  68. <label for="ninja_forms_field_<?php echo $field_id;?>_send_email" id="" style=""> 
  69. <?php _e( 'Send a copy of the form to this address?' , 'ninja-forms'); ?> 
  70. <input type="hidden" value="0" name="ninja_forms_field_<?php echo $field_id;?>[send_email]"> 
  71. <input type="checkbox" value="1" name="ninja_forms_field_<?php echo $field_id;?>[send_email]" id="ninja_forms_field_<?php echo $field_id;?>_send_email" class="ninja-forms-hidden-send-email" <?php if($send_email == 1) { echo "checked";}?>> 
  72. </label> 
  73. <a href="#" class="tooltip"> 
  74. <img id="" class='ninja-forms-help-text' src="<?php echo NINJA_FORMS_URL;?>images/question-ico.gif" title=""> 
  75. <span> 
  76. <img class="callout" src="<?php echo NINJA_FORMS_URL;?>/images/callout.gif" /> 
  77. <?php _e( 'If this box is checked, Ninja Forms will send a copy of this form (and any messages attached) to this address.', 'ninja-forms' ); ?> 
  78. </span> 
  79. </a> 
  80.  
  81. </p> 
  82. <?php