Add author name in ...
 
Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum wpForo Support Forum

[Solved] Add author name in Twitter Share content


angelochiacchio
(@angelochiacchio)
Active Member
Joined: 2 years ago
Posts: 11
Topic starter  

Hello, 
is there a way to add the name of the author when sharing a comment?
I imagine this is done in class.WpdiscuzHelper.php but I can crack it to work.

Thank you,

Angelo


Quote
Topic Tags
Astghik
(@astgh)
Support Team Admin
Joined: 4 years ago
Posts: 5139
 

Hi @angelochiacchio,

Please try the following code:

add_filter('wpdiscuz_comment_end', function ($commentOutput, $comment){
$commentOutput = preg_replace('~(<a class="wc_tw"[^>]+href=[\'\"]+[^\'\"]+)(&url[^\'\"]+[\'\"]+)~is', '$1' . urlencode(' author:' . $comment->comment_author) . '$2', $commentOutput);
return $commentOutput;
}, 10, 2);

Put the code in the active theme functions.php file. 


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 2 years ago
Posts: 11
Topic starter  

Thanks guys. Works great.

One last thing. If I tweet the comment I get a ’ instead of a simple '. Is thi sa common issue?


ReplyQuote
Astghik
(@astgh)
Support Team Admin
Joined: 4 years ago
Posts: 5139
 

@angelochiacchio,

Could you please provide us the twitter link where you see such an issue? 


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 2 years ago
Posts: 11

ReplyQuote
Astghik
(@astgh)
Support Team Admin
Joined: 4 years ago
Posts: 5139
 

ok @angelochiacchio,

this will be fixed in the next update. 


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 2 years ago
Posts: 11
Topic starter  

Ok. Looking forward then 🙂


ReplyQuote
Share:
Scroll to top