ninja_forms_field_profile_pass_display

The Ninja Forms ninja forms field profile pass display function.

Description

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

Defined (1)

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

/deprecated/includes/fields/password.php  
  1. function ninja_forms_field_profile_pass_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['default_value'] ) ) { 
  6. $default_value = $data['default_value']; 
  7. }else{ 
  8. $default_value = ''; 
  9.  
  10. if( isset( $data['adv_pass'] ) ) { 
  11. $adv_pass = $data['adv_pass']; 
  12. }else{ 
  13. $adv_pass = 0; 
  14.  
  15. $default_value_re = ''; 
  16.  
  17. if( isset( $data['label_pos'] ) ) { 
  18. $label_pos = $data['label_pos']; 
  19. }else{ 
  20. $label_pos = "left"; 
  21.  
  22. if( isset( $data['label'] ) ) { 
  23. $label = $data['label']; 
  24. }else{ 
  25. $label = ''; 
  26.  
  27. if( isset( $data['re_pass'] ) ) { 
  28. $re_pass = $data['re_pass']; 
  29. }else{ 
  30. $re_pass = ''; 
  31.  
  32. if( $label_pos == 'inside' ) { 
  33. $default_value = $label; 
  34. $default_value_re = $re_pass; 
  35.  
  36. if( isset( $data['reg_password'] ) ) { 
  37. $reg_password = $data['reg_password']; 
  38. }else{ 
  39. $reg_password = 1; 
  40.  
  41. if( $reg_password == 1 ) { 
  42. ?> 
  43. <input id="pass1_<?php echo $field_id;?>" title="" name="ninja_forms_field_<?php echo $field_id;?>" type="password" class="<?php echo $field_class;?> pass1" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" /> 
  44. </div> 
  45. <div class="ninja-forms-pass2"> 
  46. <?php 
  47. if( $label_pos == 'left' OR $label_pos == 'above' ) { 
  48. ?> 
  49. <label><?php echo $re_pass;?></label> 
  50. <?php 
  51. ?> 
  52. <input id="pass2_<?php echo $field_id;?>" title="" name="_pass_<?php echo $field_id;?>" type="password" class="<?php echo $field_class;?> pass2" value="<?php echo $default_value_re;?>" /> 
  53. <?php 
  54. if( $label_pos == 'right' OR $label_pos == 'below' ) { 
  55. ?> 
  56. <label><?php echo $re_pass;?></label> 
  57. <?php 
  58. echo '</div>'; 
  59. if( $adv_pass == 1 ) { 
  60. $class = apply_filters( 'ninja_forms_display_field_desc_class', 'description indicator-hint', $field_id ); 
  61. ?> 
  62. <div id="pass-strength-result"><?php _e( 'Strength indicator', 'ninja-forms' ); ?></div> 
  63. <p class="<?php echo $class; ?>"><?php _e( 'Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'ninja-forms' ); ?></p> 
  64. <?php 
  65.  
  66. }else{ 
  67. ?> 
  68. <input id="ninja_forms_field_<?php echo $field_id;?>" title="" name="ninja_forms_field_<?php echo $field_id;?>" type="password" class="<?php echo $field_class;?>" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" /></div> 
  69. <?php