mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-09 23:24:34 +00:00
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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user