get_comments_link
函数
      get_comments_link ( $post = 0 )    - 参数
- 
- 
                (int|WP_Post)
 $post
 Optional. Post ID or WP_Post object. Default is global $post.- Required: 否
 
 
- 
                (int|WP_Post)
- 返回值
- 
- (string) The link to the comments.
 
- 定义位置
- 
- 
                                  wp-includes/comment-template.php
 , line 814
 
- 
                                  wp-includes/comment-template.php
- 引入
- 1.5.0
- 弃用
- –
检索当前文章评论的链接。
function get_comments_link( $post = 0 ) {
	$hash          = get_comments_number( $post ) ? '#comments' : '#respond';
	$comments_link = get_permalink( $post ) . $hash;
	/**
	 * Filters the returned post comments permalink.
	 *
	 * @since 3.6.0
	 *
	 * @param string      $comments_link Post comments permalink with '#comments' appended.
	 * @param int|WP_Post $post          Post ID or WP_Post object.
	 */
	return apply_filters( 'get_comments_link', $comments_link, $post );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
 
      