• Resolved Michael Thena

    (@iscomputerman)


    I have over 300 users from different organizations. When a user logs into the site, I would like to display a list of other users from that same organization on the homepage. I use custom fields in the WP user profile to store their organization name. I know a plugin for online users exist, but this is just listing those that belong to the same organization.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @iscomputerman

    I know a plugin for online users exist

    You can use the “UM Online” plugin and add your selection of organization to the plugin widget template .../plugins/um-online/templates/online.php as a customization like the user role selection.

    foreach ( $online as $user => $last_seen ) {
    
    	um_fetch_user( $user );
    
    	$user_meta = get_userdata( $user );
    	$user_roles = $user_meta->roles;
    	if ( $roles != 'all' && count( array_intersect( $user_roles, explode( ',', $roles ) ) ) <= 0 ) {
    		continue;
    	}
    
    	// Add your organization customization here
    	
    	$name = um_user( 'display_name' );
    	if ( empty( $name ) ) {
    		continue;
    	} ?>
    • This reply was modified 1 year, 10 months ago by missveronica.
    Plugin Support andrewshu

    (@andrewshu)

    Hi @iscomputerman

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display Users with Same Custom Field’ is closed to new replies.