get_comment_author_IP WordPress Filter Hook

The get_comment_author_IP hook is used to get the IP address of the author of a comment. This can be useful for doing things like blocking IP addresses from leaving comments on your site.

apply_filters( 'get_comment_author_IP', string $comment_author_IP, string $comment_ID, WP_Comment $comment ) #

Filters the comment author’s returned IP address.


Parameters

$comment_author_IP

(string)The comment author's IP address, or an empty string if it's not available.

$comment_ID

(string)The comment ID as a numeric string.

$comment

(WP_Comment)The comment object.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.1.0The $comment_ID and $comment parameters were added.
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More