Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Created October 15, 2018 09:13
Show Gist options
  • Save rwkyyy/d43053675af6cfa89eda0d9d505865ee to your computer and use it in GitHub Desktop.
Save rwkyyy/d43053675af6cfa89eda0d9d505865ee to your computer and use it in GitHub Desktop.
remove the damn notices for non-admin.
// remove admin notices except admin
add_action('admin_head', function() {
if(!current_user_can('manage_options')){
remove_action( 'admin_notices', 'update_nag', 3 );
remove_action( 'admin_notices', 'maintenance_nag', 5 );
echo "<style>.notice, .update-nag , .error, .updated{ display:none!important; }</style>";
}
});
@todo: find all actions and remove them and if it's not enough, CSS will do the trick!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment