How to change commenter links to /user/user_id?
-
Hello,
I would to change the commenter links as shown in this screenshot:
https://i.stack.imgur.com/2mKaI.png
In my test plugin at GitHub I have first tried the following code:
define('PROFILE', '<a href="/user/%s" rel="external nofollow" class="url">%s</a>'); function get_comment_author_link($cid) { $uid = get_comment_author($cid); return sprintf(PROFILE, $uid->ID, $uid->name); } add_action('get_comment_author_link', 'get_comment_author_link');
But then by studying the file
wp-includes/comment-template.php
I have realized, that the argument toget_comment_author_link
is not a comment ID, but a string containing<a href="...">...</a>
and thus I can’t use this hook for my purpose (because the user ID can’t be found in the hook).Please advise me a suitable hook or way to change the commenter links.
Thanks
Alex
- The topic ‘How to change commenter links to /user/user_id?’ is closed to new replies.