• Would it be possible for the option to show number of users logged in on the admin bar? Useful to see at a glance while working on site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sure! Here is a sample code you can tweak to your liking. Add it to your theme’s functions.php

    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);

    Thread Starter seekbeacon

    (@seekbeacon)

    Perfect, thank you – you should add this as an option in your next release.

    I’m not the plugin author, but i’ve sent the request to their GitHub issue tracker.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display on admin bar’ is closed to new replies.