The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Solved] display name

3 Posts
2 Users
1 Reactions
1,569 Views
(@ngocvy)
Posts: 7
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#4318]

Dear support team,

Thank you so much for your great plugin.

But I have a issue, pls help me out.

Is there anyway to show the name of author comment as display name instead of their mail'sname

as below 

image
image

 
Posted : 27/06/2022 8:46 pm
Topic Tags
Asti
 Asti
(@asti)
Posts: 8257
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@ngocvy,

You should change the value of the "Display name publicly as" option. Navigate to Dashboard > Users admin page edit the user profile and change the value of the option. 

Display name as

The plugin just updates the first and last names, but not the value of the "Display name publicly as" option. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 28/06/2022 5:05 pm
(@ngocvy)
Posts: 7
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

add this code to function for who stuck like me

add_filter("wpdiscuz_comment_author", 'custom_comment_author', 10, 2 );
function custom_comment_author( $authorName, $commentID ) {

$comment = get_comment( $commentID );
$user = get_user_by( 'email', $comment->comment_author_email );

if( !$user ):

return $authorName;

else:

$firstname = get_user_meta( $user->ID, 'first_name', true );
$lastname = get_user_meta( $user->ID, 'last_name', true );

if( empty( $firstname ) OR empty( $lastname ) ):

return $authorName;

else:

return $firstname . ' ' . $lastname;

endif;

endif;

}


 
Posted : 05/07/2022 7:38 pm
Asti reacted