generate_random_password

Generates a random password.

Description

generate_random_password( (int) $len = 8 ); 

Parameters (1)

0. $len — Optional. (int) => 8
The length of password to generate. Default 8.

Usage

  1. if ( !function_exists( 'generate_random_password' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-deprecated.php'; 
  3.  
  4. // Optional. The length of password to generate. Default 8. 
  5. $len = 8; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = generate_random_password($len); 
  9.  

Defined (1)

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

/wp-includes/ms-deprecated.php  
  1. function generate_random_password( $len = 8 ) { 
  2. _deprecated_function( __FUNCTION__, '3.0.0', 'wp_generate_password()' ); 
  3. return wp_generate_password( $len );