函数原型
comment_link( int|WP_Comment $comment = null )
函数描述
Displays the link to the comments.
是否弃用
未弃用
函数参数
-
$comment
int|WP_Comment
Optional - Comment object or ID. Defaults to global comment object.
Default:
null
函数返回值
无
函数位置
File: wp-includes/feed.php.
函数源码
function comment_link( $comment = null ) {
/**
* Filters 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( $comment ) ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.4.0 | Introduced the $comment argument. |
| 1.5.0 | Introduced. |

