For example, my username is: [email protected]
So, when you want to mention my name in bbPress you should use: @tenebralyogmail-com which is pretty ugly and inappropriate, and of course the profile linked there is the bbPress profile, not the userpro one.
Possible solution (suggestion): the wordpress username should be the FIRST name or full name from facebook profiles.
Would be nice if you guys share some custom code to fix this, while we wait for definitive solution.
]]>You’ll need to add this in your theme’s functions.php or bbpress-functions.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
/** * Use the display name instead of username in bbPress profiles URL */ add_action( 'init', 'nicenames_to_display_name' ); function nicenames_to_display_name() { foreach ( get_users() as $user ) { if ( $user->data->user_status == 0 && $user->data->user_nicename != $user->data->display_name ) { $user_ids[] = $user->ID; } } foreach( $user_ids as $uid ) { $info = get_userdata( $uid ); $display_name = $info->data->display_name; if ($display_name) { $args = array( 'ID' => $uid, 'user_nicename' => strtolower(str_replace(" ", "_", $display_name)) ); wp_update_user( $args ); } } } |
source: https://bbpress.org/forums/topic/user-profile-url-uses-the-username-can-that-be-changed/
Additionally (optional) you can add this too:
1 2 3 4 5 6 7 8 9 10 11 12 |
/** * Add @mentionname after bbpress forum author details */ add_action( 'bbp_theme_after_reply_author_details', 'mentionname_to_bbpress' ); function mentionname_to_bbpress () { $user = get_userdata( bbp_get_reply_author_id() ); if ( !empty( $user->user_nicename ) ) { $user_nicename = $user->user_nicename; echo "@".$user_nicename; } } |
source: https://bbpress.org/forums/topic/putting-the-mention-below-name/
enjoy!
]]>