Title: Feature request: user role based
Last modified: November 25, 2019

---

# Feature request: user role based

 *  [vonsa](https://wordpress.org/support/users/vonsa/)
 * (@vonsa)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/feature-request-user-role-based/)
 * Hi,
 * For instance to hide notifications for all users except admin.
    Someone posted
   this one and a half year ago, you said it was a great idea and you were already
   thinking of implementing it. Is it something you’re still thinking of adding?
 * Could it possibly be done by code similar to the code shown below? And to have
   it only display for say role-administrator / role-super-administrator or however
   it’s targeted. I’m a newb so I have no idea if this is how it works, but hope
   it helps.
 * if ( is_user_logged_in() ) {
    add_filter(‘body_class’,’add_role_to_body’); add_filter(‘
   admin_body_class’,’add_role_to_body’); } function add_role_to_body($classes) {
   $current_user = new WP_User(get_current_user_id()); $user_role = array_shift(
   $current_user->roles); if (is_admin()) { $classes .= ‘role-‘. $user_role; } else{
   $classes[] = ‘role-‘. $user_role; } return $classes; }

Viewing 1 replies (of 1 total)

 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/feature-request-user-role-based/#post-12175360)
 * Hello.
 * We are still planning to update the plugin.

Viewing 1 replies (of 1 total)

The topic ‘Feature request: user role based’ is closed to new replies.

 * ![](https://ps.w.org/disable-admin-notices/assets/icon-256x256.gif?rev=3548083)
 * [Disable Admin Notices - Hide Dashboard Notifications](https://wordpress.org/plugins/disable-admin-notices/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-admin-notices/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-admin-notices/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-admin-notices/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-admin-notices/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-admin-notices/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Temyk](https://wordpress.org/support/users/webtemyk/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/feature-request-user-role-based/#post-12175360)
 * Status: not a support question