Yes, there is. You can use admin_menu
hook to loop through menu items and add span with notification. There are two classes that WP uses for these notifications update-plugins
and awaiting-mod
. The second one looks more appropriate in this case, I guess…
Here’s some code:
function add_user_menu_notification() {
global $menu;
$user_count = count_users(); // get whatever count you need
$user_count = $user_count['avail_roles']['administrator'];
if ( $user_count ) {
foreach ( $menu as $key => $value ) {
if ( $menu[$key][2] == 'users.php' ) {
$menu[$key][0] .= ' <span class="awaiting-mod">' . $user_count . '</span>';
return;
}
}
}
}
add_action( 'admin_menu', 'add_user_menu_notification' );
Related Posts:
- How to check if a user is in a specific role?
- How to restrict dashboard access to Admins only?
- Admin Page Redirect
- Check if user is admin by user ID
- How to display the user that published a pending post?
- Custom user role that can only edit specific (non-custom-type) page and all child pages [duplicate]
- Add a button to users.php
- create users to site with specific language
- Display sortable User meta column in admin panel user’s page
- How to display multiple custom columns in the wp-admin users.php?
- Hooking into register_admin_color_schemes
- Removing user fields [duplicate]
- wp-admin edit user url wont show up correct url [closed]
- Users Unable to Access Dashboard/Posts/Pages
- Stop loading “collaborators” users on add new post or page?
- Distinguish profile user and admin user IDs / get ID of user being edited
- Uncheck the box “Send User Notification” by default on new-user.php
- Detecting all admins that are logged in
- Subscribers become Authors after Upgrade? / Mass Update of Users?
- Stopping user deletion from running on error
- Filter dropdown in users.php “delete user” bulk edit screen
- Users disappeared from wp-admin
- Logout USER form backoffice after 30 minutes of inactivity [closed]
- WP admin user search doesn’t return all users
- Hide username discovery
- How to get Role Subscribe Users on Admin Menu only in Pages in WordPress
- I accidentally deleted an admin user and all their content is now gone from the site. [closed]
- Restrict submitters from wp-admin [duplicate]
- Nickname field isn’t appearing in Admin
- How to allow WordPress updates to only one specific administrator?
- Is there a filter to edit html of user-edit.php
- Create new user from phpMyAdmin
- How do I make it so that the all users page is not a white screen?
- define two login page url
- Newly created user role not displaying on users screen
- How to check if a user is in a specific role?
- On Users (user.php) in wp-admin disable/hide “Bulk Actions” and “Change Role To”
- Login issue with subdomain installs
- Hook into form handle from admin users table
- restrict admin panel sections to users
- CSRF attack to create USER
- How to keep the plugin submenu open on viewing a custom version of users.php?
- Cannot login in WordPress even after changing hash password in phpmyadmin
- WordPress User profile page fields missing
- Anyone Can Register
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box
- WordPress Users page missing user count next to different types of users
- Searching for a custom meta from user.php in the admin
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- How to display a static HTML page while setting up a WordPress site?
- How can I uninstall a language?
- How to add a custom metabox to the Menu Management admin screen?
- How to make ajax call in wordpress in right way?
- Delete Post From front Page ( With Wp-admin restriction )
- Add column to pages table
- How to get the password and username of the add new user form (admin back end) in wordpress
- Where can I edit Admin Panel Page file
- WordPress Error establishing a database connection For Admin login only
- Replace wordpress login logo with custom text
- Failed to load resource admin-ajax.php
- Why are my frontend theme styles bleeding into the backend?
- Execute script only on certain admin pages
- WordPress Options Page not working
- Restrict Author role to only 3 wp-admin pages
- Post.php is blocked by server? How to unblock? [closed]
- How to fix ‘WordPress redirection loop problem in wp-login.php page’?
- WP-Admin shows (1) update but there is no update for plugin, theme or WordPress
- Do I have to face security problems if I changing default role to Contributor
- wp-admin remove part of the url
- wp-admin 302 redirects
- Customizing WP user profile with custom fields
- How to use underscore.js in WordPress Admin
- Detect Featured Image remove while editing post in wp-admin (client-side)
- Cannot log in to the admin, no error message [closed]
- Need help for WordPress User Session Management?
- meta box on new admin page
- Create reviews and star-rating for user accounts in wp-admin [closed]
- Disable Admin CP authentication (or auto login)
- Admin top level menu, pointing to an external url
- Change of IP Address
- User Roles: How to hide a plugin from showing in WP-Admin?
- Too Many Redirects – WP-Admin Only
- WordPress admin section appears broken
- Pages section (only) not loading after publishing large number of pages
- Wp-admin widgets have no title texts
- How to create directory under my active theme directory
- wp-admin 503 error
- Locked out of site admin after change of URL
- Redirect from wp-admin back to page
- Admin page changes the $_POST data
- site identity will not update [closed]
- str_replace in wp-admin
- Admin area is not loading properly
- Using meta_query in add_query_arg
- Is it possible to change the images source that are shown in the admin side?
- Using query string on edit CPT page
- All of my WordPress sites have Bold Open Sans