Disable Non-admins from Seeing the WP Version Update Notification

One of the many, many reasons I love WordPress is that it lets you know when a newer version is up for grabs and is only a couple of clicks away. That’s sweet, but sometimes I feel annoyed when a client calls me in a busy mid-week day and tells me that I should update their website.

WordPress Update Nag

WordPress Update Nag

The following snippet lets only the administrators know the fact that there is a newer version of WordPress. Copy and pate the code below into your active theme’s functions.php.


function hide_update_notice() {
	if ( !current_user_can( 'edit_users' ) ) :
	remove_action( 'admin_notices', 'update_nag', 3 );
	endif;
}
add_action( 'admin_notices', 'hide_update_notice', 1 );

This will check if the current user can edit other users’ profiles, if it returns true, then the user is administrator and the update nag will be shown, but if the currently logged in user cannot edit the other people’s profiles it will not bother notifying them any WordPress version updates.

Have a great day and happy new year!

Now what?

This entry was posted 8 months ago on Tuesday, January 5th, 2010 at 11:44 am and is filed under WordPress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Tags: ,

2 Responses to “Disable Non-admins from Seeing the WP Version Update Notification”

  1. Flinn says:

    thnx a lot JM ,now I’ll be able to take some air in to my lungs……..my client came back to visit his sites dashboard after a couple of months ,n u wont believe me I had a tough time trying to explain him how things work.

  2. deka says:

    thanks a lot bro…
    this is what I need ..
    i’m looking for it everywhere..

Leave a reply





AboutMe

Hey ;-) Hello, this is gunnerpress.com. My name is J Mehmett; unpopular follower of WP, PSD, PHP, design, Arsenal FC and all the extremely nasty stuff... Read my profile »

MyFlickrphotos

  • Toyota Mark II
  • Riots in Bosaso I
  • Riots in Bosaso II
  • Factory
  • Bolo-Bolo
  • Soomaali baan ahay!!
  • Boat
  • Boat @ Bosaso

Go to my Flickr photos »