Core Function
View Source on Trac ↗ wp_generate_password()
wp_generate_password(
mixed $length = 12,
mixed $special_chars = true,
mixed $extra_special_chars = false
) Generates a random password drawn from the defined set of characters.
Parameters 2 required
| Name / Type | Description |
|---|---|
| $length int | Optional. The length of password to generate. Default 12. |
| bool | $special_chars Optional. Whether to include standard special characters. Default true. Required |
| bool | $extra_special_chars Optional. Whether to include other special characters. Used when generating secret keys and salts. Default false. Required |
Return Value
(string)
The random password.
Function Information
Since Version
2.5.0
Source File
wp-includes/pluggable.php
Advertisement