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

@@ -482,7 +482,7 @@ function default_password_nag_handler( $errors = false ) {
|| isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag']
) {
delete_user_setting( 'default_password_nag' );
update_user_option( $user_ID, 'default_password_nag', false, true );
update_user_meta( $user_ID, 'default_password_nag', false );
}
}
@@ -503,7 +503,7 @@ function default_password_nag_edit_user( $user_ID, $old_data ) {
// Remove the nag if the password has been changed.
if ( $new_data->user_pass != $old_data->user_pass ) {
delete_user_setting( 'default_password_nag' );
update_user_option( $user_ID, 'default_password_nag', false, true );
update_user_meta( $user_ID, 'default_password_nag', false );
}
}