diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index b49cd6914c..000c2a9707 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -64,7 +64,7 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated $random_password = wp_generate_password(); $message = __('Note that password carefully! It is a random password that was generated just for you.'); $user_id = wp_create_user($user_name, $random_password, $user_email); - update_usermeta($user_id, 'default_password_nag', true); + update_user_option($user_id, 'default_password_nag', true, true); } else { $random_password = ''; $message = __('User already exists. Password inherited.'); diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index f99cdfe8a2..51b29e2669 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -807,34 +807,33 @@ endif; add_action('admin_init', 'default_password_nag_handler'); function default_password_nag_handler($errors = false) { global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. + if ( ! get_user_option('default_password_nag') ) //Short circuit it. return; //get_user_setting = JS saved UI setting. else no-js-falback code. if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) { delete_user_setting('default_password_nag'); - update_usermeta($user_ID, 'default_password_nag', false); + update_user_option($user_ID, 'default_password_nag', false, true); } } add_action('profile_update', 'default_password_nag_edit_user', 10, 2); function default_password_nag_edit_user($user_ID, $old_data) { global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. + if ( ! get_user_option('default_password_nag') ) //Short circuit it. return; $new_data = get_userdata($user_ID); if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed. delete_user_setting('default_password_nag'); - update_usermeta($user_ID, 'default_password_nag', false); + update_user_option($user_ID, 'default_password_nag', false, true); } } add_action('admin_notices', 'default_password_nag'); function default_password_nag() { - global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) + if ( ! get_user_option('default_password_nag') ) //Short circuit it. return; echo '

'; diff --git a/wp-login.php b/wp-login.php index 7d215929bd..2beabd0c17 100644 --- a/wp-login.php +++ b/wp-login.php @@ -242,7 +242,7 @@ function reset_password($key, $login) { do_action('password_reset', $user, $new_pass); wp_set_password($new_pass, $user->ID); - update_usermeta($user->ID, 'default_password_nag', true); //Set up the Password change nag. + update_user_option($user_ID, 'default_password_nag', true, true); //Set up the Password change nag. $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n"; $message .= site_url('wp-login.php', 'login') . "\r\n";