Docs: Improve the usefulness of docs for wp_generate_password()
by noting the use of wp_rand() vs rand()
or mt_rand()
.
Props webdevmattcrom. Fixes #42782. git-svn-id: https://develop.svn.wordpress.org/trunk@42373 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2e5bbe0667
commit
1c2b0762c7
@ -2312,6 +2312,9 @@ if ( ! function_exists( 'wp_generate_password' ) ) :
|
|||||||
/**
|
/**
|
||||||
* Generates a random password drawn from the defined set of characters.
|
* Generates a random password drawn from the defined set of characters.
|
||||||
*
|
*
|
||||||
|
* Uses wp_rand() is used to create passwords with far less predictability
|
||||||
|
* than similar native PHP functions like `rand()` or `mt_rand()`.
|
||||||
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*
|
*
|
||||||
* @param int $length Optional. The length of password to generate. Default 12.
|
* @param int $length Optional. The length of password to generate. Default 12.
|
||||||
@ -2348,7 +2351,7 @@ endif;
|
|||||||
|
|
||||||
if ( ! function_exists( 'wp_rand' ) ) :
|
if ( ! function_exists( 'wp_rand' ) ) :
|
||||||
/**
|
/**
|
||||||
* Generates a random number
|
* Generates a random number.
|
||||||
*
|
*
|
||||||
* @since 2.6.2
|
* @since 2.6.2
|
||||||
* @since 4.4.0 Uses PHP7 random_int() or the random_compat library if available.
|
* @since 4.4.0 Uses PHP7 random_int() or the random_compat library if available.
|
||||||
|
Loading…
Reference in New Issue
Block a user