Skip to content

Instantly share code, notes, and snippets.

@steppohub
Created November 27, 2014 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steppohub/737bd0185f5b0aa936cd to your computer and use it in GitHub Desktop.
Save steppohub/737bd0185f5b0aa936cd to your computer and use it in GitHub Desktop.
Remove annoying (problematic!) default password nag that doesn't disappear
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