title

Hide update warning for every user but admin

 

Hide update warning for every user but admin

10 Mai 2013, Posted by antoine in

That’s a useful warning, you know, sometimes they launch a new version and you didn’t  know about it. But it’s quite unprofessional if your client or even subscribers know about it, right? So why not just show them to blog admin? Use this:

<?php
function wp_hide_update() {
        global $current_user;
        get_currentuserinfo();

        if ($current_user->ID != 1) { // only admin will see it
            remove_action( 'admin_notices', 'update_nag', 3 );
        }
    }
    add_action('admin_menu','wp_hide_update');
?>