![]() |
This code will ensures that no users other than "admin" are notified by WordPress when updates are available.. |
Example:
PHP
// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN
global $user_login;
get_currentuserinfo();
if ($user_login !== "admin") { // Change admin to the username that gets the updates
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
}
Example:
PHP
// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN
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;" ) );
}
How to Enable Hidden Administration Feature displaying All Site Settings | Wordpress Administration Shortcode |
How to change the Login Logo & Image URL Link | Wordpress Administration Shortcode |
How to Remove Update Notification for all users except ADMIN User | Wordpress Administration Shortcode |
How to Remove Default WordPress Meta Boxes | Wordpress Administration Shortcode |
How to Remove "Wordpress" to "WordPress" filter | Wordpress Administration Shortcode |
How to Customize the order of the administration menu | Wordpress Administration Shortcode |
How to Add Thumbnails in Manage Posts/Pages List | Wordpress Administration Shortcode |
Remove Update Notification for all users except ADMIN User | Wordpress Administration Shortcode |
Changed version to only show update notification for admin users (as opposed to just the user 'admin'): | Wordpress Administration Shortcode |
Read Full: | Wordpress Administration Shortcode |
Category: | Web Tutorial |
Sub Category: | Wordpress Administration Shortcode |
Uploaded by: | Admin |
Views: | 74 |
Tested on: | WordPress 3.0.1 |
Reffered: https://wordpress.stackexchange.com/questions/1567/best-collection-of-code-for-your-functions-php-file