Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbpress profile integrates with bp


John James Jacoby
Keymaster

@johnjamesjacoby

Quick suggestion, although I bet many people won’t run into this issue…

function oci_get_userdata($u){
$u = (int) $u;
$user = bb_get_user($u);
if ($user->bbGroups) {
return stripslashes_deep((array)$user->bbGroups);
} else {
return stripslashes_deep((array)$user);
}
}

Then, I changed…

function oci_user_name($u){
$bp_user = oci_get_userdata($u);
if ($bp_user['fullname']) {
return $bp_user['fullname'];
} else {
return $bp_user['display_name'];
}
}

Basically, I integrated my forums before installing BuddyPress, so there are users that haven’t updated their BuddyPress profiles that won’t have fullname’s yet… This way I have all of their normal info to manipulate later and still get their original wordpress display_name to fallback on…

There is probably a much prettier way of doing this, but this is the solution my tired brain could come up with for now.

Skip to toolbar