Hide Updates from All Non-Administrator Roles

This should not be used to avoid updating WordPress!!!  I use it, along with infiniteWP.com, to make the core update process seamless for me and invisible for my clients.  Add to functions.php file.

   global $user_login;
   get_currentuserinfo();

       if (!current_user_can('update_plugins')) { // checks to see 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;" ) );
       }

 

Dave Winter focuses in WordPress UI Design and WordPress Plugin Development (some have labelled him a fanatic) but has hands in many other projects, including photography and music. He's never far from a computer... or an iPad (for testing purposes, of course). If you've been to a WordCamp in Southern California, he probably already knows who you are (or maybe not - he's terrible with names). Dave currently teaches courses at California State University, Long Beach alongside his small business at dauid.us (and his students think he's pretty boss).
© 2008-2020, dauid.us