Posted By

krembo99 on 10/24/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

DaR3Y


Wordpress - remove update nag and version to all but admin (2 snippets)


 / Published in: PHP
 

  1. /** --1 --- **/
  2.  
  3. if ( !current_user_can( 'install_themes' ) ) {
  4. add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
  5. add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
  6. }
  7.  
  8. /** --2 --- **/
  9.  
  10. <?php
  11. function wp_hide_update() {
  12. global $current_user;
  13. get_currentuserinfo();
  14.  
  15. if ($current_user->ID != 1) { // only admin will see it
  16. remove_action( 'admin_notices', 'update_nag', 3 );
  17. }
  18. }
  19. add_action('admin_menu','wp_hide_update');
  20. ?>

Report this snippet  

You need to login to post a comment.