ninja_forms_field_number_edit

The Ninja Forms ninja forms field number edit function.

Description

ninja_forms_field_number_edit( $field_id, $data ); 

Parameters (2)

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

Usage

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

Defined (1)

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

/deprecated/includes/fields/number.php  
  1. function ninja_forms_field_number_edit( $field_id, $data ) { 
  2.  
  3. $plugin_settings = nf_get_settings(); 
  4.  
  5. $custom = ''; 
  6. // Default Value 
  7. if( isset( $data['default_value'] ) ) { 
  8. $default_value = $data['default_value']; 
  9. } else { 
  10. $default_value = ''; 
  11. if( $default_value == 'none' ) { 
  12. $default_value = ''; 
  13.  
  14. ?> 
  15. <div class="description description-thin"> 
  16. <span class="field-option"> 
  17. <label for=""> 
  18. <?php _e( 'Default Value' , 'ninja-forms' ); ?> 
  19. </label><br /> 
  20. <select id="default_value_<?php echo $field_id;?>" name="" class="widefat ninja-forms-_text-default-value"> 
  21. <option value="" <?php if( $default_value == '' ) { echo 'selected'; $custom = 'no'; } ?>><?php _e( 'None', 'ninja-forms' ); ?></option> 
  22. <option value="_user_id" <?php if( $default_value == '_user_id') { echo 'selected'; $custom = 'no'; } ?>><?php _e( 'User ID (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="_custom" <?php if( $custom != 'no') { echo 'selected'; } ?>><?php _e( 'Custom', 'ninja-forms' ); ?> -></option> 
  25. </select> 
  26. </span> 
  27. </div> 
  28. <div class="description description-thin"> 
  29.  
  30. <label for="" id="default_value_label_<?php echo $field_id;?>" style="<?php if($custom == 'no') { echo 'display:none;'; } ?>"> 
  31. <span class="field-option"> 
  32. <?php _e( 'Default Value' , 'ninja-forms' ); ?><br /> 
  33. <input type="number" class="widefat code" 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;?>" /> 
  34. </span> 
  35. </label> 
  36.  
  37. </div> 
  38. <?php