Created
November 27, 2014 22:53
-
-
Save steppohub/737bd0185f5b0aa936cd to your computer and use it in GitHub Desktop.
Remove annoying (problematic!) default password nag that doesn't disappear
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('admin_notices', 'aa99_delete_pass_nag', 1); | |
function aa99_delete_pass_nag() { | |
remove_action('admin_notices','default_password_nag'); | |
} | |
function aa99_add_password_nag() { | |
global $pagenow; | |
if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) | |
return; | |
echo '<div class="error default-password-nag">'; | |
echo '<p>Visit your '; | |
printf( '<a href="%s">' . __('profile page') . '</a> to update your password at any time. ', admin_url('profile.php') . '#password' ); | |
echo '</p></div>'; | |
} | |
add_action('admin_notices', 'aa99_add_password_nag'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment