Created
November 15, 2020 16:36
-
-
Save codezz/3d73d66e3ce810cf0e5dfcfe98b3194e to your computer and use it in GitHub Desktop.
BuddyPress Nouveau Template - Change username to name in messages interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'wp_ajax_messages_get_user_message_threads', 'stax_bpb_change_messages_username', 9 ); | |
| function stax_bpb_change_messages_username() { | |
| add_filter('bp_core_get_username', function( $name ) { | |
| $user = get_user_by('login', $name); | |
| if ($user) { | |
| $name = $user->display_name; | |
| } | |
| return $name; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment