Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

'wpdiscuz_profile_url' suport for return false

3 Posts
2 Users
0 Reactions
1,993 Views
(@drlightman)
Active Member
Joined: 6 years ago
Posts: 13
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
  [#4658]

Could be possibile that returning false with that filter wpdiscuz_profile_url we avoid the linking of the username totally at the beginning of the comment form?

Thanks



   
Quote
Elvina
(@elvina)
Support
Joined: 7 years ago
Posts: 1403
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
 

Hi @drlightman,

There are two following options to hide the link of the username:

1. You can use the following CSS code:

div#wc_show_hide_loggedin_username a:first-child {
color: currentColor !important;
cursor: not-allowed !important;
text-decoration: none !important;
pointer-events: none !important;
}

The CSS code should be added in the Dashboard > Comments > Settings > Styling > "Custom CSS code" textarea. 

2. or you can use the following JS code:

jQuery( "#wc_show_hide_loggedin_username a:first-child " ).removeAttr("href");

The js code you should add in your active them's js files.

In any case, please don't forget to delete all caches and press Ctrl+F5 (twice) on the frontend before checking to reload the updated CSS/JS files. 



   
ReplyQuote
(@drlightman)
Active Member
Joined: 6 years ago
Posts: 13
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
 

Hello,

thank you for the suggestion @elvina

In my case I was asked to make the modification urgently so I had to mod the code myself, as follows if interested:

replaced:

echo $wpdiscuz->optionsSerialized->phrases['wc_logged_in_as'] . ' <a href="' . $user_url . '">' . $wpdiscuz->helper->getCurrentUserDisplayName($currentUser) . '</a> | ' . $logout;

with:

if (false === $user_url) {
echo $wpdiscuz->optionsSerialized->phrases['wc_logged_in_as'] . ' <strong>' . $wpdiscuz->helper->getCurrentUserDisplayName($currentUser) . '</strong> | ' . $logout;
}
else {
echo $wpdiscuz->optionsSerialized->phrases['wc_logged_in_as'] . ' <a href="' . $user_url . '">' . $wpdiscuz->helper->getCurrentUserDisplayName($currentUser) . '</a> | ' . $logout;
}

And added a filter to 'wpdiscuz_profile_url' in functions.php returning false.

The reason I was asked to do so is that for users who have not written any articles yet - and for commenters, they are the majority - the url leads to a 404 page, that may be confusing and I didn't know any other kind of working url to replace it with.



   
ReplyQuote
Share:
Scroll to top