函数原型
comment_author_IP( int|WP_Comment $comment_ID )
函数描述
Displays the IP address of the author of the current comment.
是否弃用
未弃用
函数参数
-
$comment_ID
int|WP_Comment
Optional - WP_Comment or the ID of the comment for which to print the author’s IP address.
Default current comment.
函数返回值
无
函数位置
File: wp-includes/comment-template.php.
函数源码
function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
echo esc_html( get_comment_author_IP( $comment_ID ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.4.0 | Added the ability for $comment_ID to also accept a WP_Comment object. |
| 0.71 | Introduced. |

