[wp-trac] [WordPress Trac] #23692: feed_links should have a parameter to choose which feed to display
WordPress Trac
noreply at wordpress.org
Tue Mar 5 14:02:13 UTC 2013
#23692: feed_links should have a parameter to choose which feed to display
-----------------------------+-------------------------
Reporter: Confridin | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Feeds
Version: | Severity: minor
Keywords: dev-feedback |
-----------------------------+-------------------------
Hello,
'''feed_links''' is a function located in
wp_includes/general_template.php. It displays 2 feeds in the header : the
main feed and the comment feed. The function is activated along with
feed_links_extra when automatic-feed-links support is activated.
Currently, developers can't choose if they want both feeds to be
displayed, or just one of them. I think this function should be improved.
Here is the current function :
{{{
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('»', 'feed link'),
/* translators: 1: blog title, 2: separator (raquo) */
'feedtitle' => __('%1$s %2$s Feed'),
/* translators: %s: 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="' . get_feed_link() . "\" />\n";
echo '<link rel="alternate" type="' . feed_content_type() . '"
title="' . esc_attr(sprintf( $args['comstitle'], get_bloginfo('name'),
$args['separator'] )) . '" href="' . get_feed_link( 'comments_' .
get_default_feed() ) . "\" />\n";
}
}}}
Currently, the only way to display only one feed (the main post feed or
the main comment feed) so is to deactivate feed_links with :
{{{
remove_action('wp_head', 'feed_links', 2);
}}}
and then to create our own function to only display one feed.
Do you think this should be improved ?
Regards,
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23692>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list