Hi @famous,
anything directly related to URL for bp is listed here:
http://hookr.io/plugins/buddypress/#index=l&search=url
In most case, you can built a link by array, which generally extend pre existing parameters. It’s very variable and depend where and how the link shoud work.
Here some exemple snippets to add a link to a member’s profile.
/* add external link on buddy menu bar */
function bpfr_menubar_link() {
global $bp;
if ( !is_user_logged_in() )
return false;
$link = bp_get_loggedin_user_link();
$bp->bp_nav[$slug] = array(
'name' => 'View my profile',
'slug' => 'super_link',
'link' => $link,
'css_id' => 'super-link',
'position' => 20
);
}
add_action( 'bp_core_new_nav_item', 'bpfr_menubar_link', 999 );
/* link to profile on SWA page */
function goto_my_profile_tab() {
if ( !is_user_logged_in() )
return false;
if ( bp_is_active( 'xprofile' ) )
echo '<li><a href="'. bp_get_loggedin_user_link() .'">View my profile</a></li>';
}
add_action( 'bp_activity_type_tabs', 'goto_my_profile_tab' ); // SWA page
add_action( 'bp_members_directory_member_types', 'goto_my_profile_tab' ); // members directory page
/* shortcode linking to profile [xyz] */
function bpfr_link_to_profile() {
return '<a href="'. bp_get_loggedin_user_link() .'">View my profile</a>';
}
add_shortcode( 'xyz', 'bpfr_link_to_profile' );
Another technique for groups here.
In hope this will help you to go further.
Exactly what I needed, thanks @danbp