mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Passwords: Deprecate second parameter of wp_new_user_notification().
The second parameter `$plaintext_pass` was removed in [33023] and restored as `$notify` in [33620] with a different behavior. If you have a plugin overriding `wp_new_user_notification()` which hasn't been updated you would get a notification with your username and the password "both". To prevent this the second parameter is now deprecated and reintroduced as the third parameter. Adds unit tests. Props kraftbj, adamsilverstein, welcher, ocean90. Fixes #33654. (Don't ask for new pluggables kthxbye) git-svn-id: https://develop.svn.wordpress.org/trunk@34116 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1690,16 +1690,22 @@ if ( !function_exists('wp_new_user_notification') ) :
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
|
||||
* @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter.
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database object for queries.
|
||||
* @global PasswordHash $wp_hasher Portable PHP password hashing framework instance.
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
* @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
|
||||
* string (admin only), or 'both' (admin and user). The empty string value was kept
|
||||
* for backward-compatibility purposes with the renamed parameter. Default empty.
|
||||
* @param int $user_id User ID.
|
||||
* @param null $deprecated Not used (argument deprecated).
|
||||
* @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
|
||||
* string (admin only), or 'both' (admin and user). The empty string value was kept
|
||||
* for backward-compatibility purposes with the renamed parameter. Default empty.
|
||||
*/
|
||||
function wp_new_user_notification( $user_id, $notify = '' ) {
|
||||
function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
|
||||
if ( $deprecated !== null ) {
|
||||
_deprecated_argument( __FUNCTION__, '4.3.1' );
|
||||
}
|
||||
|
||||
global $wpdb, $wp_hasher;
|
||||
$user = get_userdata( $user_id );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user