pre_comment_user_ip
Filters the comment author's IP address before it is set.
Usage
add_filter( 'pre_comment_user_ip', 'wp_kama_pre_comment_user_ip_filter' ); /** * Function for `pre_comment_user_ip` filter-hook. * * @param string $comment_author_ip The comment author's IP address. * * @return string */ function wp_kama_pre_comment_user_ip_filter( $comment_author_ip ){ // filter... return $comment_author_ip; }
- $comment_author_ip(string)
- The comment author's IP address.
Changelog
Since 1.5.0 | Introduced. |
Where the hook is called
pre_comment_user_ip
wp-includes/comment.php 2183
$commentdata['comment_author_IP'] = apply_filters( 'pre_comment_user_ip', $commentdata['comment_author_IP'] );