I've created a custom tab to my buddypress user profiles called 'goals'

It displays xprofile fields, I just need to know how to make a dynamic link on the subnav that points at the 'goals' xprofile edit link tab which for example would look like


The subnav is currently being generated via the following, however I've tried a few variations of the link parameter however can't get it to structure properly.

bp_core_new_subnav_item( array(
  'name'            => 'Edit Goals',
  'slug'            => 'edit-goals',
  'parent_url'      => 'goals',
  'parent_slug'     => 'goals',
  'screen_function' => 'false',
  'position'        => 50,
  'link'            => get_option('siteurl') . '/profile/edit/group/8/'

 ) );

closed as off-topic by Pieter Goosen, Robert hue, Mayeenul Islam, cybmeta, TheDeadMedic Feb 16 '15 at 13:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.


Use bp_core_get_user_domain($user_id). This will give you the url part up to the username (with a slash at the end).

Try something like the following:

  • Got it working using the following global $current_user; get_currentuserinfo(); $user_id=bp_displayed_user_id(); $link= home_url() . '/members/' . $current_user->user_login . '/profile/edit/group/8'; – Dexx Feb 18 '15 at 1:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.