feed_links

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

WordPress Version: 6.3

/**
 * Displays the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between site name and feed type in feed links. */
        'separator' => _x('»', 'feed link'),
        /* translators: 1: Site title, 2: Separator (raquo). */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: Site title, 2: Separator (raquo). */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    /**
     * Filters whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        printf('<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n", feed_content_type(), esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])), esc_url(get_feed_link()));
    }
    /**
     * Filters whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        printf('<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n", feed_content_type(), esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])), esc_url(get_feed_link('comments_' . get_default_feed())));
    }
}

WordPress Version: 6.1

/**
 * Displays the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between blog name and feed type in feed links. */
        'separator' => _x('&raquo;', 'feed link'),
        /* translators: 1: Blog title, 2: Separator (raquo). */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: Blog title, 2: Separator (raquo). */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    /**
     * Filters whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        printf('<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n", feed_content_type(), esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])), esc_url(get_feed_link()));
    }
    /**
     * Filters whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        printf('<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n", feed_content_type(), esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])), esc_url(get_feed_link('comments_' . get_default_feed())));
    }
}

WordPress Version: 5.3

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between blog name and feed type in feed links. */
        'separator' => _x('&raquo;', 'feed link'),
        /* translators: 1: Blog title, 2: Separator (raquo). */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: Blog title, 2: Separator (raquo). */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    /**
     * Filters whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    }
    /**
     * Filters whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
    }
}

WordPress Version: 4.6

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between blog name and feed type in feed links */
        'separator' => _x('&raquo;', 'feed link'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    /**
     * Filters whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    }
    /**
     * Filters whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
    }
}

WordPress Version: 4.4

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between blog name and feed type in feed links */
        'separator' => _x('&raquo;', 'feed link'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    /**
     * Filter whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    }
    /**
     * Filter whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
    }
}

WordPress Version: 3.7

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array(
        /* translators: Separator between blog name and feed type in feed links */
        'separator' => _x('&raquo;', 'feed link'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'feedtitle' => __('%1$s %2$s Feed'),
        /* translators: 1: blog title, 2: separator (raquo) */
        'comstitle' => __('%1$s %2$s Comments Feed'),
    );
    $args = wp_parse_args($args, $defaults);
    echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
}