Make WordPress Core

Ticket #11380: 11380.diff

File 11380.diff, 1.5 KB (added by Denis-de-Bernardy, 15 years ago)
  • wp-admin/includes/user.php

     
    792792add_action('admin_init', 'default_password_nag_handler');
    793793function default_password_nag_handler($errors = false) {
    794794        global $user_ID;
    795         if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it.
     795        if ( get_usermeta($user_ID, 'default_password_nag') === array() ) //Short circuit it.
    796796                return;
    797797
    798798        //get_user_setting = JS saved UI setting. else no-js-falback code.
    799         if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
     799        if ( ! get_usermeta($user_ID, 'default_password_nag') || 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
    800800                delete_user_setting('default_password_nag');
    801                 update_usermeta($user_ID, 'default_password_nag', false);
     801                update_usermeta($user_ID, 'default_password_nag', array());
     802                dump(get_usermeta($user_ID, 'default_password_nag'));
    802803        }
    803804}
    804805
     
    812813
    813814        if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.
    814815                delete_user_setting('default_password_nag');
    815                 update_usermeta($user_ID, 'default_password_nag', false);
     816                update_usermeta($user_ID, 'default_password_nag', array());
    816817        }
    817818}
    818819