comment_author_IP
Display the IP address of the author of the current comment.
Description
comment_author_IP( (int) $comment_ID = 0 );
Parameters (1)
- 0. $comment_id — Optional. (int)
-
WP_Comment
or the ID of the comment for which to print the author's IP address.
Usage
if ( !function_exists( 'comment_author_IP' ) ) { require_once ABSPATH . WPINC . '/comment-template.php'; } // Optional. WP_Comment or the ID of the comment for which to print the author's IP address. // Default current comment. $comment_id = -1; // NOTICE! Understand what this does before running. $result = comment_author_IP($comment_id);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/comment-template.php
- function comment_author_IP( $comment_ID = 0 ) {
- echo esc_html( get_comment_author_IP( $comment_ID ) );
- }