Skip to content

Instantly share code, notes, and snippets.

@dipakcg
Created August 24, 2014 11:24
Show Gist options
  • Save dipakcg/a7e9fe1a21968863a8e4 to your computer and use it in GitHub Desktop.
Save dipakcg/a7e9fe1a21968863a8e4 to your computer and use it in GitHub Desktop.
WordPress - Display update notification for Admins
/* Adding this PHP code to the functions.php of WordPress theme will only display WordPress update notifications to admin users. */
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;" ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment