X

Display Update Notification for Admins

Snippets by IsItWP

Do you want to display WordPress update notifications to admin users only? While there’s probably a plugin for this, we have created a quick and useful code snippet that you can use to display update notification for admins in WordPress.

Instructions:

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

       global $user_login;
       get_currentuserinfo();
       if (!current_user_can('update_plugins')) {
        add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
        add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
       }

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 18 Jetpack alternatives to get the features without bloat and how to add a portfolio to your WordPress site.

Comments   Leave a Reply

  1. 5 Nuevos Snippets para Wordpress | Eliseos.net January 18, 2011 at 5:09 pm

    […] tendrían que poder visualizar los mensajes de actualizaciones de WordPress o plugins.Fuente: Display update notification for admins Compartir articulo via → Guardar en Delicious Delicoius Compartir en Facebook Facebook Tweet […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!