Ticket #9710: 9710.2.diff
| File 9710.2.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('user_profile_update_errors', 'default_password_nag_edit_user'); 808 function default_password_nag_edit_user($errors) { 809 global $user_ID; 810 if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. 811 return; 812 813 $codes = $errors->get_error_codes(); 814 if ( empty($codes) && !empty($_POST['pass1']) ) { //Remove the nag if the password has been changed. 815 delete_user_setting('default_password_nag'); 816 update_usermeta($user_ID, 'default_password_nag', false); 817 } 818 } 819 802 820 add_action('admin_notices', 'default_password_nag'); 803 821 function default_password_nag() { 804 822 global $user_ID;