bp_groups_admin_get_usernames_from_ids( array $user_ids = array() )

Get a set of usernames corresponding to a set of user IDs.

Description

Parameters

$user_ids

(Optional) Array of user IDs.

Default value: array()

Return

(array) Array of user_logins corresponding to $user_ids.

Source

File: bp-groups/bp-groups-admin.php

function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {

	$usernames = array();
	$users     = new WP_User_Query( array( 'blog_id' => 0, 'include' => $user_ids ) );

	foreach ( (array) $users->results as $user ) {
		$usernames[] = $user->user_login;
	}

	return $usernames;
}

Changelog

Changelog
Version Description
BuddyPress 1.7.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.