Ticket #9710: 9710.3.diff
| File 9710.3.diff, 1.4 KB (added by , 17 years ago) |
|---|
-
wp-admin/includes/user.php
792 792 endif; 793 793 794 794 add_action('admin_init', 'default_password_nag_handler'); 795 function default_password_nag_handler() { 795 function default_password_nag_handler($errors = false) { 796 global $user_ID; 797 if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. 798 return; 799 800 //get_user_setting = JS saved UI setting. else no-js-falback code. 796 801 if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) { 797 global $user_ID;798 802 delete_user_setting('default_password_nag'); 799 803 update_usermeta($user_ID, 'default_password_nag', false); 800 804 } 801 805 } 806 807 add_action('profile_update', 'default_password_nag_edit_user', 10, 2); 808 function default_password_nag_edit_user($user_ID, $old_data) { 809 global $user_ID; 810 if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. 811 return; 812 813 $new_data = get_userdata($user_ID); 814 815 if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed. 816 delete_user_setting('default_password_nag'); 817 update_usermeta($user_ID, 'default_password_nag', false); 818 } 819 } 820 802 821 add_action('admin_notices', 'default_password_nag'); 803 822 function default_password_nag() { 804 823 global $user_ID;