By default, the platform does not have this option. You can use the following function code.


Please follow the steps below:


1. Go to Appearance > Theme Editor.

2. Under Select theme to edit, choose (BuddyBoss Child/whatever theme is active), then click Select.

3. Below Theme Files, select Theme Functions (functions.php).

4. Append the code just before the closing PHP tag “?>”:


// Add [bb-print-username] shortcode
function bb_print_username() {
  $current_user = wp_get_current_user();

  $display_name = function_exists( 'bp_core_get_user_displayname' ) ? bp_core_get_user_displayname( $current_user->ID ) : $current_user->display_name;
    
  echo esc_html( $display_name );
}
add_shortcode( 'bb-print-username', 'bb_print_username' ); 

5. Click Update File to save the changes.

6. Now, insert **_[bb-print-username]_** shortcode to any of your links that need to have a dynamic username, for example:


https://demos.buddyboss.com/online-communities/members/**[bb-print-username]**/settings/


Note: Any modifications are considered as custom work already. Know more about our Support Policy here: https://www.buddyboss.com/support-policy/