Adding the Number of Users to the WordPress Dashboard
When promoting the site, you will have more and more visitors to register and it is important to be aware of all those, who was registered. In order to see the current number of users, you just need to add a short code snippet, after that in your console (Dashbor) a new item appears.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function dashboard_wps_user_count() { global $wpdb; $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); ?> <table> <tbody> <tr class="first"> <td class="first b b_pages"><a href="users.php"><? echo $users; ?></a></td> <td class="t pages"><a href="users.php">Members</a></td> </tr> </tbody> </table> <?} add_action( 'right_now_content_table_end', 'dashboard_wps_user_count'); |
The code works, I checked everything. Good luck developing your own plugins, think, the code will be useful to you.
/*
- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.