Make WordPress Core


Ignore:
Timestamp:
02/06/2010 06:20:38 AM (15 years ago)
Author:
dd32
Message:

Switch to *_user_option() for default password nag to avoid extra DB queries. Fixes #11380

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r12766 r12983  
    808808function default_password_nag_handler($errors = false) {
    809809    global $user_ID;
    810     if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it.
     810    if ( ! get_user_option('default_password_nag') ) //Short circuit it.
    811811        return;
    812812
     
    814814    if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
    815815        delete_user_setting('default_password_nag');
    816         update_usermeta($user_ID, 'default_password_nag', false);
     816        update_user_option($user_ID, 'default_password_nag', false, true);
    817817    }
    818818}
     
    821821function default_password_nag_edit_user($user_ID, $old_data) {
    822822    global $user_ID;
    823     if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it.
     823    if ( ! get_user_option('default_password_nag') ) //Short circuit it.
    824824        return;
    825825
     
    828828    if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.
    829829        delete_user_setting('default_password_nag');
    830         update_usermeta($user_ID, 'default_password_nag', false);
     830        update_user_option($user_ID, 'default_password_nag', false, true);
    831831    }
    832832}
     
    834834add_action('admin_notices', 'default_password_nag');
    835835function default_password_nag() {
    836     global $user_ID;
    837     if ( ! get_usermeta($user_ID, 'default_password_nag') )
     836    if ( ! get_user_option('default_password_nag') ) //Short circuit it.
    838837        return;
    839838
Note: See TracChangeset for help on using the changeset viewer.