Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed. We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

'wpdiscuz_profile_url' suport for return false

3 Posts
2 Users
0 Reactions
1,355 Views
(@drlightman)
Active Member
Joined: 6 years ago
Posts: 13
Topic starter  

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: 6 years ago
Posts: 1403
 

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  

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