Created
September 1, 2016 13:40
-
-
Save champsupertramp/0dd6164432fa625aad989b96e02defd9 to your computer and use it in GitHub Desktop.
Ultimate Member - change display name with custom name per user role
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 | |
// Requires Ultimate Member v1.3.68+ | |
// Change Displayname for Business category profiles | |
add_filter("um_user_display_name_filter","um_custom_businessname", 10, 2); | |
function um_custom_businessname( $name, $profile_id ){ | |
um_fetch_user( $profile_id ); | |
if( um_user('role') == 'business' ){ | |
$name = um_user("first_name"); | |
} | |
return $name; | |
} | |
?> |
Hi @champsupertramp , how do i make it display different names for different roles with additional text. For instance;
If role is Agent set the display name as Agent Username
If role is Distributor set the display name as Dist. Username
Thanks in anticipation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you man