post_comments_feed_link

The timeline below displays how wordpress function post_comments_feed_link has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.3

/**
 * 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Optional. Descriptive link text. Default 'Comments Feed'.
 * @param int    $post_id   Optional. Post ID. Default is the ID of the global `$post`.
 * @param string $feed      Optional. Feed type. Possible values include 'rss2', 'atom'.
 *                          Default is the value of get_default_feed().
 */
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. Possible values include 'rss2', 'atom',
     *                        or an empty string for the default feed type.
     */
    echo apply_filters('post_comments_feed_link_html', $link, $post_id, $feed);
}

WordPress Version: 4.6

/**
 * 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Optional. Descriptive link text. Default 'Comments Feed'.
 * @param int    $post_id   Optional. Post ID. Default is the ID of the global `$post`.
 * @param string $feed      Optional. Feed format. Default empty.
 */
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);
}

WordPress Version: 4.5

/**
 * Display 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Descriptive text.
 * @param int    $post_id   Optional post ID. Default to current post.
 * @param string $feed      Optional. Feed format.
 */
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>';
    /**
     * Filter 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);
}

WordPress Version: 4.4

/**
 * Display 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Descriptive text.
 * @param int    $post_id   Optional post ID. Default to current post.
 * @param string $feed      Optional. Feed format.
*/
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>';
    /**
     * Filter 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);
}

WordPress Version: 4.3

/**
 * Display 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Descriptive text.
 * @param int    $post_id   Optional post ID. Default to current post.
 * @param string $feed      Optional. Feed format.
*/
function post_comments_feed_link($link_text = '', $post_id = '', $feed = '')
{
    $url = esc_url(get_post_comments_feed_link($post_id, $feed));
    if (empty($link_text)) {
        $link_text = __('Comments Feed');
    }
    /**
     * Filter 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', "<a href='{$url}'>{$link_text}</a>", $post_id, $feed);
}

WordPress Version: 3.9

/**
 * Display 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.
 *
 * @since 2.5.0
 *
 * @param string $link_text Descriptive text.
 * @param int $post_id Optional post ID. Default to current post.
 * @param string $feed Optional. Feed format.
 * @return string Link to the comment feed for the current post.
*/
function post_comments_feed_link($link_text = '', $post_id = '', $feed = '')
{
    $url = esc_url(get_post_comments_feed_link($post_id, $feed));
    if (empty($link_text)) {
        $link_text = __('Comments Feed');
    }
    /**
     * Filter 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', "<a href='{$url}'>{$link_text}</a>", $post_id, $feed);
}

WordPress Version: 3.7

/**
 * Display 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.
 *
 * @package WordPress
 * @subpackage Feed
 * @since 2.5.0
 *
 * @param string $link_text Descriptive text.
 * @param int $post_id Optional post ID. Default to current post.
 * @param string $feed Optional. Feed format.
 * @return string Link to the comment feed for the current post.
*/
function post_comments_feed_link($link_text = '', $post_id = '', $feed = '')
{
    $url = esc_url(get_post_comments_feed_link($post_id, $feed));
    if (empty($link_text)) {
        $link_text = __('Comments Feed');
    }
    echo apply_filters('post_comments_feed_link_html', "<a href='{$url}'>{$link_text}</a>", $post_id, $feed);
}