Changeset 11217
- Timestamp:
- 05/06/2009 04:19:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/user.php
r11204 r11217 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() {
Note: See TracChangeset
for help on using the changeset viewer.