comment_link()

显示一个留言发布链接

描述

显示评论链接

用法

<?php comment_link() ?>

参数

None.

返回值

(void)  此函数不返回值。

示例

创建指向单个注释的锚定永久链接:

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

<a href=“<?php comment_link(); ?>“>Permalink to this comment</a>

上面显示的代码将导致(取决于您的永久链接设置)如下所示:

/* ———————————-
* wordpress函数 XingKongWeb.com
* ———————————- */

<a href=“<a class=”external free” href=”http://example.com/2009/07/15/example-post/comment-page-1/#comment-3″>http://example.com/2009/07/15/example-post/comment-page-1/#comment-3</a>”>Permalink to this comment</a>

注意

回显返回值 get_comment_link()。

历史

添加于 版本: 1.5.0

源文件

comment_link() 函数的代码位于 wp-includes/feed.php.

/* ———————————-
* wordpress函数 Xingkongweb.com收集
* ———————————- */
/**
* Display the link to the comments.
*
* @since 1.5.0
*/

function comment_link() {

/**

* Filter the current comment’s permalink.
*
* @since 3.6.0
*
* @see get_comment_link()
*
* @param string $comment_permalink The current comment permalink.
*/

echo esc_url( apply_filters( ‘comment_link’, get_comment_link() ) );

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