General: Avoid unnecessary calls to update_user_option().

The `update_user_option()` function is a way to update a user meta value after adding a blog’s prefix to the beginning of the meta key. But when the fourth parameter is `true`, the behavior is exactly the same as calling `update_user_meta()` directly.

This replaces all instances of `update_user_option()` when the fourth parameter is `true` in Core with a direct call to `update_user_meta()` to prevent an unnecessary call to `update_user_option()`.

Props johnjamesjacoby, zkancs, obenland, desrosj.
Fixes #43339.

git-svn-id: https://develop.svn.wordpress.org/trunk@50981 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2021-05-24 19:58:13 +00:00
parent dda2f6af36
commit c3ef52ded7
7 changed files with 16 additions and 17 deletions

View File

@@ -2873,7 +2873,7 @@ function reset_password( $user, $new_pass ) {
do_action( 'password_reset', $user, $new_pass );
wp_set_password( $new_pass, $user->ID );
update_user_option( $user->ID, 'default_password_nag', false, true );
update_user_meta( $user->ID, 'default_password_nag', false );
/**
* Fires after the user's password is reset.
@@ -2984,7 +2984,7 @@ function register_new_user( $user_login, $user_email ) {
return $errors;
}
update_user_option( $user_id, 'default_password_nag', true, true ); // Set up the password change nag.
update_user_meta( $user_id, 'default_password_nag', true ); // Set up the password change nag.
/**
* Fires after a new user registration has been recorded.