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

返回介绍

comments_link()

发布于 2017-09-10 字数2104 浏览 1055 评论 0

comments_link( string $deprecated = '',  string $deprecated_2 = '' )

Display the link to the current post comments.


描述


参数

$deprecated

(string)
(Optional)
Not Used.

Default value: ”

$deprecated_2

(string)
(Optional)
Not Used.

Default value: ”


源代码

File: wp-includes/comment-template.php

function comments_link( $deprecated = '', $deprecated_2 = '' ) {
	if ( !empty( $deprecated ) )
		_deprecated_argument( __FUNCTION__, '0.72' );
	if ( !empty( $deprecated_2 ) )
		_deprecated_argument( __FUNCTION__, '1.3.0' );
	echo esc_url( get_comments_link() );
}

更新日志

Version 描述
0.71 Introduced.

相关函数

Uses

  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/functions.php:
    _deprecated_argument()
  • wp-includes/comment-template.php:
    get_comments_link()

Used By

  • wp-includes/embed.php:
    print_embed_comments_button()
  • wp-includes/comment-template.php:
    comments_popup_link()

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

    Example

    
    <a href="<?php comments_link(); ?>">
        Comments to this post
    </a>
    

    Note: The output of comments_link() is already escaped by core.

上一篇:codepress_get_lang()

下一篇:comments_link_feed()

发布评论

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

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