Skip to content

Instantly share code, notes, and snippets.

@sjaved87
Created September 19, 2015 09:48
Show Gist options
  • Save sjaved87/f4369f2608a7c4786827 to your computer and use it in GitHub Desktop.
Save sjaved87/f4369f2608a7c4786827 to your computer and use it in GitHub Desktop.
remove notices for all users except admins
function hide_update_noticee_to_all_but_admin_users()
{
if (!current_user_can('update_core')) {
remove_all_actions( 'admin_notices' );
}
}
add_action( 'admin_head', 'hide_update_noticee_to_all_but_admin_users', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment