Opened 2 years ago
Closed 2 years ago
#17823 closed feature request (invalid)
feed_links() ask for comments_open()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Feeds | Version: | 3.2 |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: |
Description
Current will WordPress also include the comment-feed with hook wp_head and function feed_links. Maybe a small changes on this function make it usefull for use WordPress without comments on themes.
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'),
);
if ( (get_option('default_comment_status') != 'open') )
unset( $defaults['comstitle'] );
$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";
if ( (get_option('default_comment_status') == 'open') )
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";
}
Attachments (1)
Change History (10)
The 'default_comment_status' option reflects the default status for comments on new posts/pages, not necessarily the status of existing content.
Theme authors can easily unhook the 'feed_links' action if so desired.
maybe we can add comments_open() to the default_comment_stutus.
Current it give many sites with a comment feed and no active comment-function on the theme and many theme outhors dont change this. Yes she can remove the function, but she must also add the other feeds or add custom function for feed_links.
comments_open() is for the current post/page though, whereas the comments feed given is for the entire blog.
yes, but we can check for an post/page, if has open comments. If is not a post_type with open comments, than is the feed useless.
The current post/page status isn't representative of the entire blog or the post type overall.
yes, i understand this; but we can check about all post_types for open comment; not realy the patch - right, but possible and more effizient for the users.
That would require post types to have had comments disabled by the theme, unless you're suggesting checking all posts in the database?
I don't see how that's in any way more efficient than the theme author changing behaviour as desired, especially since there's already support for that.
yes, this its the way.
I think, it is not konsist - the feed_links check not for comments, feed_links_extra() to do this. Yes, the functions have different tasks, but the return is only important, it give it data.

patch for see the difference