comments_link() WordPress Function

The comments_link() function displays a link to the comments section of a post. This function is useful for post templates that display the post content on the front page of a site. When a user clicks on the link, they will be taken to the comments section of the post.

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

Displays the link to the current post comments.


Parameters

$deprecated

(string)(Optional)Not Used.

Default value: ''

$deprecated_2

(string)(Optional)Not Used.

Default value: ''


Top ↑

Source

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() );
}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More