bb_generate_password

Generates a random password drawn from the defined set of characters.

Description

(string) bb_generate_password( (int) $length = 12, (bool) $special_chars = true ); 

Returns (string)

the password

Parameters (2)

0. $length — Optional. (int) => 12
The length.
1. $special_chars — Optional. (bool) => true
The special chars.

Usage

  1. if ( !function_exists( 'bb_generate_password' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php'; 
  3.  
  4. // The length. 
  5. $length = 12; 
  6.  
  7. // The special chars. 
  8. $special_chars = true; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_generate_password($length, $special_chars); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php  
  1. function bb_generate_password( $length = 12, $special_chars = true ) { 
  2. return WP_Pass::generate_password( $length, $special_chars );