On this page
comments_link( string $deprecated = '', string $deprecated_2 = '' )
Displays the link to the current post comments.
Parameters
$deprecatedstring Optional-
Not Used.
Default:
'' $deprecated_2string Optional-
Not Used.
Default:
''
Source
File: wp-includes/comment-template.php. View all references
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() );
}
Related
Uses
| Uses | Description |
|---|---|
| get_comments_link() wp-includes/comment-template.php | Retrieves the link to the current post comments. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
| _deprecated_argument() wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
Used By
| Used By | Description |
|---|---|
| print_embed_comments_button() wp-includes/embed.php | Prints the necessary markup for the embed comments button. |
| comments_popup_link() wp-includes/comment-template.php | Displays the link to the comments for the current post ID. |
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/comments_link