Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add the count to the admin toolbar #53

Open
pixeline opened this issue Dec 20, 2022 · 0 comments
Open

how to add the count to the admin toolbar #53

pixeline opened this issue Dec 20, 2022 · 0 comments

Comments

@pixeline
Copy link

Hi! this is just to share how I display the current online user count in the admin toolbar:


function add_users_online_count_to_admin_toolbar($wp_admin_bar) {

	if (function_exists('users_online')){
		$users_online = get_users_online_count();
		$wp_admin_bar->add_node( array(
			'id'		=> 'users_online',
			'title' => ' users online: '.$users_online ,
			'href' => '#',
		) );
	}
}

add_action('admin_bar_menu', 'add_users_online_count_to_admin_toolbar', 999);

Thank you for this nifty plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant