Update Informations Only for Admins
January 8th, 2009 by Frank • WordPress Hacks • leave a Comment
If you only want to let users, who are privileged to receive information about updates and plugins, you should copy the following code to your functions.php of your theme. These users have to have the right "edit plugin" (edit_plugins) to receive updates.
Alternative: use the plugin Secure WordPress, the plugin has inside the function to active this possibility.
/**
* remove core-Update-Information
* @rights: http://codex.wordpress.org/Roles_and_Capabilities
*/
if ( !current_user_can( 'edit_plugins' ) ) {
// core update
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ) );
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
// plugin update
add_action( 'admin_menu', create_function( '$a', "remove_action( 'load-plugins.php', 'wp_update_plugins' );" ) );
add_action( 'admin_init', create_function( '$a', "remove_action( 'admin_init', 'wp_update_plugins' );" ), 2 );
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_update_plugins' );" ), 2 );
add_filter( 'pre_option_update_plugins', create_function( '$a', "return null;" ) );
}
Info
- Published in WordPress Hacks
- Tags: PHP, update, WordPress, WordPress Tutorials
- Comment feed
- read: 9797 | today: 2
- leave a Comment
Comments are closed.

