apply_filters( 'random_password', string $password, int $length, bool $special_chars, bool $extra_special_chars )
- Since
- 3.0.0, 5.3.0
Filters the randomly-generated password.
Compatibility
- WordPress
- since 5.3.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$passwordstring- The generated password.
$lengthint- The length of password to generate.
$special_charsbool- Whether to include standard special characters.
$extra_special_charsbool- Whether to include other special characters.
Where this hook fires · 1
wp-includes/pluggable.php:2989wp_generate_password()
Source code
* * @param string $password The generated password. * @param int $length The length of password to generate. * @param bool $special_chars Whether to include standard special characters. * @param bool $extra_special_chars Whether to include other special characters. */ return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars ); }endif; if ( ! function_exists( 'wp_rand' ) ) : /** * Generates a random non-negative number.Changelog
Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
Added the
$length, $special_chars, and $extra_special_chars parameters.from the docblock3.0.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.