Reply To: Changing avatar images and profile links
So i’ve had some success trying to change the profile links with this code:
function _bp_core_get_user_domain($domain) {
$url = get_home_url();
$user_id = bp_get_member_user_id();
if (empty($user_id)) {
$user_id = bp_get_activity_user_id();
}
if (empty($user_id)) {
//$user_id = bp_displayed_user_id();
}
$user_info = get_userdata($user_id);
$link = $user_info->display_name;
$domain = '' . $url . '/profiles/' . $link . '';
return $domain;
}
add_filter('bp_core_get_user_domain', '_bp_core_get_user_domain', 10, 4);
apply_filters( 'bp_get_activity_user_link', '_bp_core_get_user_domain', 15, 1);
This seems to work on every profile link except the one in the activity header section. This link is being changed but just to /profiles/. The display name is not being added to the end… so looking at my code this means i’m not retrieving the user id in the activity. Strangely enough though the user avatar next to the post has the correct link applied to it with the above filter! Any ideas?
My other option is to use the buddypress member profile location but replace it with my profile templates. I tried to implement this by creaing a members/single/home.php in my wordpress custom theme folder… but the profile loads inside another page, i get a page within a page type effect with the username above the inner page… not sure what is going on there? If anyone can help with either of these solutions i’d really appreciate it!
James