Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

"Remove Update Notification for all users except ADMIN User"

I have 2 administrators in my wordpress, but I only want that one of them see the "Update Notification". I've inserted this code on my funtions.php file and change name of one of my adminastrator login name the code - if ($user_login !== "miguel") - but it didnt' work?

Any help? Thanks

share|improve this question

1 Answer 1

this works fine for a specific user login:

 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;" ) );
   }

and this for a specific user id:

global $user_ID;
   get_currentuserinfo();
   if ($user_ID !== 1) { // change 1 to the id number 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;" ) );
   }
share|improve this answer
    
Hi Bainternet, Thanks I tried also with the ID but still not working? I dont know if this is because I also installed on line of code to hide some wp menus? <?php add_action('admin_head', 'hide_menus'); function hide_menus() { global $current_user; get_currentuserinfo(); If($current_user->user_login != 'admin') { ?> <style> #menu-plugins{ display:none; } #menu-appearance{ display:none; } #menu-settings{ display:none; } #menu-links{ display:none; } #menu-users{ display:none; } #menu-tools{ display:none; } </style> <?php } }?> –  Miguel Jun 2 '11 at 13:35
    
Glad i could help. –  Bainternet Jun 2 '11 at 13:35
    
Do you think this is a problem? –  Miguel Jun 2 '11 at 13:59
    
I've just tried with your code and it still works so that's not it. –  Bainternet Jun 2 '11 at 14:25
1  
I'm new to this... Do you think is the palce where I insert the code on funtions.php ( locate on:/wp-content/themes/mytheme/funtions.php)? –  Miguel Jun 2 '11 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.