1

As I already told, I'm setting up a Blog for a friend. Next to not being him an administrator but an editor that can make changes to theme options) I have an additional question.

I don't want him to worry about updates as well nor do I want him bothering me, but the problem is, editors do see a slightly changed variant of the update nag.

Is there a way to disable those for non-admins?

It's just the case that we normally do know about Wordpress updates even before they get packaged and released.

2

You may have to adjust the capability.

add_action( 'admin_init', 'hide_update_msg', 1 );
function hide_update_msg()
{
    ! current_user_can( 'install_plugins' ) 
        and remove_action( 'admin_notices', 'update_nag', 3 );
}
|improve this answer|||||
  • Basically right, but it's admin_init where you need to hook into. Then it works. Thanks! – hakre Mar 25 '11 at 17:18
  • @hakre init fires in the backend too, but I changed the code to admin_init. It is more clear this way. – fuxia Mar 25 '11 at 23:04
  • when init had fired in the backend, the filter update_nag had no hooks registered, with admin_init it had. My (your) callback was fired with both hooks, but for init there was nothing to remove. Just FYI. – hakre Mar 26 '11 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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