Custom get_comment_author_link function doesn’t work
-
Hi,
I was hoping someone can help with this issue.
No matter what example I use, or alternative method I do myself, the author link is still visible in my comments section, I’ve even checked the core function within the dev references to see how this is called.
Initially, I thought there was a jetpack conflict since I was using comments from there, but even with this jetpack function turned off the username still returns a link, in my case to myblog.com/authors/emailaddress. Either way, whether it is a link to the users URL or an author page, I would like to remove it, but do not seem to see the issue here and it is super frustrating 🙁
Any help would be appreciated.
An example of many I’ve used…
/**
* Removes the comment author link
* @author Ren Ventura <EngageWP.com>
* @link engagewpdotcom/remove-wordpress-comment-author-link
*
* @param string $return The HTML-formatted comment author link (empty for an invalid URL)
* @param string $author The comment author’s username
* @param int $comment_ID The comment ID
*
* @return string $author
*/
add_filter( ‘get_comment_author_link’, ‘rv_remove_comment_author_link’, 10, 3 );
function rv_remove_comment_author_link( $return, $author, $comment_ID ) {
return $author;
}
The topic ‘Custom get_comment_author_link function doesn’t work’ is closed to new replies.