-
If someone register trough facebook button, the “username” defined is the email address.
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.
Solution:
You’ll need to add this in your theme’s functions.php or bbpress-functions.php
PHP1234567891011121314151617181920212223/*** 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:
PHP123456789101112/*** 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!
You must be logged in to reply to this topic.