Quantcast
Channel: WordPress.com Forums » Recent Topics
Viewing all articles
Browse latest Browse all 74536

knnknn on "How can I display the comment_author_IP in a get_comment_author filter?"

$
0
0

I want to display the IP directly after the comment author's name.

"Author (IP:123.231.191.11)"

Thus I added a filter:

<?php

function addip($author='')
{
return $author.' (IP:'.get_comment_author_IP().')'
}

add_filter('get_comment_author','addip');
?>

My question: Is this the correct code? Does "get_comment_author_IP()" (= without any ID) know automatically the correct comment?


Viewing all articles
Browse latest Browse all 74536

Trending Articles