I would count the number of users that registered than an hour ago. Then display it to the admin bar.
Count users –
<?php
$arrUsers = get_users();
$strDate = date("Y-m-d H:i:s", strtotime('-1 hour'));
$intNewUsers = 0;
if(is_array($arrUsers)) {
foreach ($arrUsers as $key => $value) {
if($key == "user_registered" && $value > $strDate) {
$intNewUsers++;
}
}
}
echo $intNewUsers." New Users Since ".$strDate;
?>
My code might not be accurate, but its a good start:)
Alter the admin bar – https://www.isitwp.com/add-links-to-wordpress-3-3-new-toolbar/
-
This reply was modified 5 years, 8 months ago by
bcworkz. Reason: code fixed
Hey @unfinishedcode, when you post code in these forums, please demarcate with backticks or use the code button. Otherwise the forum’s parser corrupts your code, making it difficult for others to use it. I fixed the code in your last reply to this topic so consuleregroup can use it without encountering syntax errors.
Awesome, thanks dude. Will do so in the future.