comment_ID()

显示当前评论的ID

描述

显示当前注释的数字 ID。此标记必须位于循环或注释循环中。

使用 get_comment_ID 检索值。

用法

 <?php comment_ID(); ?> 

参数

此函数不接受参数

返回值

请参阅 get_comment_ID() 返回结果

示例

默认用法

/* ———————————-
* wordpress函数 星空站长网 收集
* ———————————- */

<p>This is comment <?php comment_ID(); ?> for all comments.</p>

注释 ID 作为定位点 ID

使用注释 ID 作为注释的定位点 ID。

/* ———————————-
* wordpress函数 Xingkongweb.com收集
* ———————————- */

<div id=“comment-<?php comment_ID() ?>“>Comment by

<?php comment_author() ?>: </div>

<div class=“comment-text”><?php comment_text() ?></div>

历史

添加于 版本: 1.5.0

源文件

comment_ID() 函数的代码位于 wp-includes/comment-template.php

/**
* Display the comment id of the current comment.
*
* @since 0.71
*/

function comment_ID() {

echo get_comment_ID();

}
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索