BuddyPress commone link to user/member profile

I need add static link to menu for redirect user to profile BuddyPress. But BP have only individual links for each user.

I writed short snippet for add root endpoint /my-profile/ and redirect to user profile.

//Add root endpoint /my-profile/
function wpcc_add_redirect_endpoint() {
    add_rewrite_endpoint( 'my-profile', EP_ROOT );
add_action( 'init', 'wpcc_add_redirect_endpoint' );

//Add redirect for endpoint
function wpcc_profile_redirect(){
  $check = get_query_var('my-profile', false);

  if($check === ''){
add_action( "template_redirect", 'wpcc_profile_redirect' );


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s