comment_author_IP() - WordPress 函数参考中文文档

返回介绍

comment_author_IP()

发布于 2017-09-10 字数1697 浏览 1031 评论 0

comment_author_IP( int|WP_Comment $comment_ID )

Display 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 ) {
	echo esc_html( get_comment_author_IP( $comment_ID ) );
}

更新日志

Version 描述
4.4.0 Added the ability for $comment_ID to also accept a WP_Comment object.
0.71 Introduced.

相关函数

Uses

  • wp-includes/formatting.php:
    esc_html()
  • wp-includes/comment-template.php:
    get_comment_author_IP()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Displays comment author IP

    Posted from: <?php comment_author_IP(); ?>

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!