Skip to content

Instantly share code, notes, and snippets.

@wbcomdev
Created June 2, 2021 06:11
Show Gist options
  • Select an option

  • Save wbcomdev/65a1fbce19978253fdcd0863de2deac3 to your computer and use it in GitHub Desktop.

Select an option

Save wbcomdev/65a1fbce19978253fdcd0863de2deac3 to your computer and use it in GitHub Desktop.
<?php
/**
* Create a custom url for groups directory.
*/
function wbcom_create_custom_bp_url( $path ) {
$user_ids = get_current_user_id();
$username = bp_core_get_user_displayname( $user_ids );
$path = 'members/' . $username . '/groups/';
return $path;
}
add_filter( 'bp_uri', 'wbcom_create_custom_bp_url' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment