From 4512e94f9cba40815ebea9c17b815152db2ce884 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 27 Jun 2019 00:47:41 +0000 Subject: [PATCH] Users: Pass `$length`, `$special_chars`, and `$extra_special_chars` parameters to the `random_password` filter in `wp_generate_password()`. Props roytanck. Fixes #47092. git-svn-id: https://develop.svn.wordpress.org/trunk@45568 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/pluggable.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index dace6cd5b8..c5a248c6a5 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -2384,10 +2384,14 @@ if ( ! function_exists( 'wp_generate_password' ) ) : * Filters the randomly-generated password. * * @since 3.0.0 + * @since 5.3.0 Added the `$length`, `$special_chars`, and `$extra_special_chars` parameters. * - * @param string $password The generated password. + * @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 ); + return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars ); } endif;