Created
October 15, 2018 09:13
-
-
Save rwkyyy/d43053675af6cfa89eda0d9d505865ee to your computer and use it in GitHub Desktop.
remove the damn notices for non-admin.
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
// 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