1. Customize
  2. Leaderboards
  3. Add link to BuddyPress user profile

Add link to BuddyPress user profile

The following snippet shows how to add a link to the BuddyPress user profile page on user and avatar column.

function my_prefix_buddypress_link_on_leaderboards( $output, $leaderboard_id, $position, $item, $column_name, $leaderboard_table ) {

    return bp_core_get_userlink( $item['user_id'] );

}
add_filter( 'gamipress_leaderboards_leaderboard_column_display_name', 'my_prefix_buddypress_link_on_leaderboards', 10, 6 );
// This line makes the link work also on the user avatar column
add_filter( 'gamipress_leaderboards_leaderboard_column_avatar', 'my_prefix_buddypress_link_on_leaderboards', 10, 6 );
Was this article helpful to you? Yes No

How can we help?