How to hide/disable any plugin notices for non admin users in dashboard? Can you please help me with this? Thanks
4 Answers
The simplest way would be to hide the notifications via CSS, see below:
function hide_update_msg_non_admins(){
if (!current_user_can( 'manage_options' )) { // non-admin users
echo '<style>#setting-error-tgmpa>.updated settings-error notice is-dismissible, .update-nag, .updated { display: none; }</style>';
}
}
add_action( 'admin_head', 'hide_update_msg_non_admins');
A more detailed answer can be found here.