Skip to:
Content
Pages
Categories
Search
Top
Bottom

Link To User's Profile In Their Comment?


  • KeonD
    Participant

    @keond

    How do I link a user’s forum profile from their name in their comment. So far I’ve got this code in functions.php but it doesn’t seem to work:

    function force_comment_author_url($comment)
    {
    // does the comment have a valid author URL?
    $no_url = !$comment->comment_author_url || $comment->comment_author_url == ‘http://’;
    
    if ($comment->user_id && $no_url) {
    // comment was written by a registered user but with no author URL
    $comment->comment_author_url = ‘http://www.examplesite.co.uk/forums/users/=’ . $comment->username;
    }
    return $comment;
    }
    add_filter(‘get_comment’, ‘force_comment_author_url’);

    Please can somebody tell me where I’m going wrong?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.