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.
Source
Changelog
Version | Description |
---|---|
4.1.0 | The $comment_ID and $comment parameters were added. |
1.5.0 | Introduced. |