HTTP/2 301
server: nginx
date: Sat, 27 Dec 2025 03:33:53 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/functions/comments_link/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Sat, 27 Dec 2025 03:33:54 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
comments_link() – Function | Developer.WordPress.org
comments_link( string $deprecated = '', string $deprecated_2 = '' )
Displays the link to the current post comments.
$deprecatedstringoptionalNot Used.
Default:''
$deprecated_2stringoptionalNot Used.
Default:''
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() );
}
View all references View on Trac View on GitHub
| Version | Description |
|---|
| 0.71 | Introduced. |
Example
Note: The output of
comments_link()is already escaped by core.