WordPress at a glance

post_comments_feed_link() WP 1.0

Displays the comment feed link for a post.

Prints out the comment feed link for a post. Link text is placed in the anchor. If no link text is specified, default text is used. If no post ID is specified, the current post is used.

Hooks from function:
Return

Nothing (null).

Usage

post_comments_feed_link( $link_text, $post_id, $feed );
$link_text(string)
Descriptive link text.
Default: 'Comments Feed'
$post_id(int)
Post ID.
Default: ID of the global $post
$feed(string)
Feed format.
Default: ''

Code of post_comments_feed_link: wp-includes/link-template.php VER 4.9.8

<?php
function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {
	$url = get_post_comments_feed_link( $post_id, $feed );
	if ( empty( $link_text ) ) {
		$link_text = __('Comments Feed');
	}

	$link = '<a href="' . esc_url( $url ) . '">' . $link_text . '</a>';
	/**
	 * Filters the post comment feed link anchor tag.
	 *
	 * @since 2.8.0
	 *
	 * @param string $link    The complete anchor tag for the comment feed link.
	 * @param int    $post_id Post ID.
	 * @param string $feed    The feed type, or an empty string for the default feed type.
	 */
	echo apply_filters( 'post_comments_feed_link_html', $link, $post_id, $feed );
}

Related Functions

From category: Feeds

More from Template Tags: Comments

No comments
    Hello, !     Log In . Register