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')) {
you can include some custom css in your functions.php that hides the update_nag (notifications) element dependent on user capability:
Updating this answer the original code below will remove the nag screen but it will ping the server for updates on every load, thanks to @ El Yobo, see update below.
This will disable the core updates and the nag screen to everyone but superadmins.
To disable all plugin notifications;
To remove a specific plugin you can try this but it is not 100% going to work depending on the plugin;
Updated
This disable updates completely (I cannot get it to work based on user roles) AND stop pinging for updates (It will throw a PHP warning not sure how to fix this without altering core).
I didn’t manage to work with those scripts above so I researched a bit more and found this:
Deriving from @wyck’s answer, all update notices and PHP warnings are now hidden using the script below. Just place this in your
functions.php