bb_profile_password_form

The BuddyPress bb profile password form function.

Description

bb_profile_password_form( (int) $id = 0 ); 

Parameters (1)

0. $id — Optional. (int)
The id.

Usage

  1. if ( !function_exists( 'bb_profile_password_form' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4. // The id. 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_profile_password_form($id); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_profile_password_form( $id = 0 ) { 
  2. global $errors; 
  3. if ( !$user = bb_get_user( bb_get_user_id( $id ) ) ) 
  4. return; 
  5.  
  6. if ( !bb_current_user_can( 'change_user_password', $user->ID ) ) 
  7. return; 
  8.  
  9. $class = 'form-field'; 
  10.  
  11. if ( $message = $errors->get_error_message( 'pass' ) ) { 
  12. $class .= ' form-invaliderror; 
  13. $message = '<em>' . esc_html( $message ) . '</em>'; 
  14. ?> 
  15.  
  16. <table> 
  17. <tr class="<?php echo $class; ?>"> 
  18. <th scope="row" rowspan="2"> 
  19. <label for="pass1"><?php _e('New password'); ?></label> 
  20. <?php echo $message; ?> 
  21. </th> 
  22. <td> 
  23. <input name="pass1" type="password" id="pass1" autocomplete="off" /> 
  24. </td> 
  25. </tr> 
  26. <tr class="<?php echo $class; ?>"> 
  27. <td> 
  28. <input name="pass2" type="password" id="pass2" autocomplete="off" /> 
  29. </td> 
  30. </tr> 
  31. <tr class="pass-strength"> 
  32. <th scope="row"><?php _e('Password Strength'); ?></th> 
  33. <td> 
  34. <input type="hidden" name="user_login" id="user_login" value="<?php echo $user->user_login; ?>" /> 
  35. <noscript> 
  36. <?php _e('Disabled (requires JavaScript)'); ?> 
  37. </noscript> 
  38. <script type="text/javascript" charset="utf-8"> 
  39. if (typeof jQuery != 'undefined') { 
  40. document.writeln('<div id="pass-strength-result">' + pwsL10n.short + '</div>'); 
  41. } else { 
  42. document.writeln('<?php echo str_replace("'", "\'", __('Disabled.')); ?>') 
  43. </script> 
  44. </td> 
  45. </tr> 
  46. </table> 
  47.  
  48. <p><?php _e('Hint: Use upper and lower case characters, numbers and symbols like !"?$%^&( in your password.'); ?></p> 
  49.  
  50. <?php 
  51.