I need to get the id of the user by searching it on the input field. lets say i need an id of the user ‘adre'(which is 33 actually). Any help would be appreciated.
// this way i can get username with user id.
$user_ID = 33;
$user = new BP_Core_User( $user_ID );
$user_array = $user->profile_data;
echo $user_nicename=$user_array['user_nicename']; // adre
// now i need to get user id by username.
//echo bp_displayed_user_id();
Try this
get_userdatabylogin
or this
$field is for
(string) (required) ‘id’, ‘slug’, ’email’, or ‘login’
$value is for
(string|integer) (required) Search for this field value