Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change user profile URL in activity stream?


  • wzshop
    Participant

    @wzshop

    Hi,
    I want to change the user profile url for the activity stream, so that these are linked to a custom profile page. Ive found the link below, but in my case this only edits the link of the user avatar and not of the in-text link in the activity stream like: %avatar% “user_x just signed up”. Now the %avatar% is linked to the custom profile page but the user_x is still linked to the BP profile page.. How to fix this?

    function imborx_profile_link( $link ) {
    global $activities_template; 
    if( $link != bp_loggedin_user_domain() )
    $link = esc_url( get_author_posts_url( $activities_template->activity->user_id ) );
    return $link; 
    }
    add_filter( 'bp_get_activity_user_link', 'imborx_profile_link', 15, 1 );
Viewing 3 replies - 1 through 3 (of 3 total)

  • wzshop
    Participant

    @wzshop

    Ok these 2 functions did it for me:

    // define the bp_core_get_userlink callback 
    function filter_bp_core_get_userlink( $a_href_url_display_name_a, $user_id ) { 
    	$user_info = get_userdata($user_id);
    	$name = $user_info->display_name;
    	$link = esc_url( get_author_posts_url($user_id) );
    	$a_href_url_display_name_a = '<a href ="'.$link.'">'.$name.'</a>';
    	return $a_href_url_display_name_a;
    }
    add_filter( 'bp_core_get_userlink', 'filter_bp_core_get_userlink', 10, 2 ); 
    function imborx_profile_link( $link ) {
    global $activities_template; 
    if( $link != bp_loggedin_user_domain() )
    $link = esc_url( get_author_posts_url( $activities_template->activity->user_id ) );
    return $link; 
    }
    add_filter( 'bp_get_activity_user_link', 'imborx_profile_link', 15, 1 );

    wzshop
    Participant

    @wzshop

    The above 2 functions work on all profile pictures and only some in-text usernames… Not sure why.. Does anybody have a comprehensive solution for this?
    Thanks


    wzshop
    Participant

    @wzshop

    Nevermind, the above two functions work. I had a problem with some other code that is fixed now!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar