For registered users to my blog, if they click on the dashboard, they get an alert suggesting that they tell the site administrator (me) that the new version of WordPress is available.
All I want is to hide dashboard alerts from the subscribers. Where can I find the code to change this?
I found a site here that suggests that I’m looking for the code:
add_action('admin_head','addDashboardAlert');
But I don’t know where to look for it.
UPDATE
I found some more relevant code to make the alerts conditional on user role, here:
if (!current_user_can('delete_posts')) {
4 Answers
you can include some custom css in your functions.php that hides the update_nag (notifications) element dependent on user capability:
add_action('admin_head','admin_css');
function admin_css()
{
if(!current_user_can('administrator'))//not and admin
{
echo '<style>';
echo '.update_nag{display:none}';
echo '</style>';
}
}