get_comment_author_IP filter-hookWP 1.5.0

Filters the comment author's returned IP address.

Usage

add_filter( 'get_comment_author_IP', 'wp_kama_get_comment_author_IP_filter', 10, 3 );

/**
 * Function for `get_comment_author_IP` filter-hook.
 * 
 * @param string     $comment_author_IP The comment author's IP address, or an empty string if it's not available.
 * @param string     $comment_ID        The comment ID as a numeric string.
 * @param WP_Comment $comment           The comment object.
 *
 * @return string
 */
function wp_kama_get_comment_author_IP_filter( $comment_author_IP, $comment_ID, $comment ){

	// filter...
	return $comment_author_IP;
}
$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.

Changelog

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

Where the hook is called

get_comment_author_IP()
get_comment_author_IP
wp-includes/comment-template.php 281
return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase

Where the hook is used in WordPress

Usage not found.