WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 3 days ago

#9134 assigned defect (bug)

cannot remove the link to comments in feeds

Reported by: jidanni Owned by: chriscct7
Milestone: 4.4 Priority: normal
Severity: normal Version: 2.7
Component: Feeds Keywords: has-patch needs-refresh
Focuses: Cc:

Description

In feed-rss2.php, etc. there is no easy to turn off the comments link, for blogs that
have no, and don't allow, comments. So the link

<comments><?php comments_link(); ?></comments>

is just a waste. Same with

<wfw:commentRss><?php echo get_post_comments_feed_link(); ?></wfw:commentRss>

Yes. I can turn off comments, and remove all comments, but I cannot
remove the link to comments (without hacking the core.)

Attachments (3)

9134.diff (975 bytes) - added by sivel 7 years ago.
9134-v2.patch (2.1 KB) - added by peaceablewhale 6 years ago.
9134.patch (1.5 KB) - added by hakre 4 years ago.
Make Comments in RSS2 and ATOM feed filterable.

Download all attachments as: .zip

Change History (22)

comment:1 @jidanni7 years ago

  • Cc jidanni@… added

@sivel7 years ago

comment:2 @sivel7 years ago

  • Cc matt@… added
  • Keywords has-patch needs-testing added

First shot. Haven't looked at other feeds yet.

comment:3 @Denis-de-Bernardy6 years ago

  • Keywords needs-patch added; has-patch needs-testing removed
  • Milestone set to 2.8

test should be: if exists comments or comments are open. and this also needs to be in other feed templates.

comment:4 @peaceablewhale6 years ago

  • Keywords has-patch added; needs-patch removed

Changed keyword to has-patch

comment:5 @Denis-de-Bernardy6 years ago

  • Keywords 2nd-opinion added

probably still not there.

link to comments should probably show if: comments or pings are present (get_comments_number()), or if comments or pings are opened (comments_open()
pings_open())

link to the comments feed should show if comments or pings are opened, regardless if whether any comments are present.

also, it may be worth checking that the fields can be omitted per specs.

comment:6 follow-up: @peaceablewhale6 years ago

The comment element is optional: http://www.rssboard.org/rss-specification#ltcommentsgtSubelementOfLtitemgt. wfw:commentRss is a RSS extension and therefore it is optional. All Atom Thread links are not required.

Why should the comment link be included when ping is enabled? I think that the comment link is for replying to the post or referencing the current comments of the post only.

comment:7 in reply to: ↑ 6 @Denis-de-Bernardy6 years ago

Replying to peaceablewhale:

Why should the comment link be included when ping is enabled? I think that the comment link is for replying to the post or referencing the current comments of the post only.

Hence the 2nd-opinion. WP treats comments and pings as the same animal. Unless I'm mistaking both will show in the comments feed.

comment:8 follow-up: @peaceablewhale6 years ago

I am afraid that putting the ping link in atom:link[@rel="replies"] is a violation to RFC 4685:

An Atom link element with a rel attribute value of "replies" may be
used to reference a resource where responses to an entry may be
found. If the type attribute of the atom:link is omitted, its value
is assumed to be "application/atom+xml".

If there is no comment and comment is disabled, the link does not seem to conform to "reference a resource where responses to an entry".

comment:9 in reply to: ↑ 8 ; follow-up: @Denis-de-Bernardy6 years ago

Replying to peaceablewhale:

If there is no comment and comment is disabled, the link does not seem to conform to "reference a resource where responses to an entry".

I think one could also argue that pingbacks and trackbacks also qualify as such if listed in the comments list... Let's get a third opinion.

comment:10 @Denis-de-Bernardy6 years ago

  • Milestone changed from 2.8 to 2.9

Moving to 2.9, from lack of traction.

comment:11 @Denis-de-Bernardy6 years ago

  • Keywords 2nd-opinion removed

comment:12 @Denis-de-Bernardy6 years ago

  • Keywords needs-patch added; has-patch removed

broken patch

@peaceablewhale6 years ago

comment:13 @peaceablewhale6 years ago

  • Keywords has-patch added; needs-patch removed

comment:14 @ryan6 years ago

  • Milestone changed from 2.9 to Future Release

comment:15 @chrishajer6 years ago

I was just looking for a way to do this and was disappointed to learn it can't be done without hacking the core. Is there a way to do it with a plugin?

comment:16 in reply to: ↑ 9 @hakre4 years ago

Replying to Denis-de-Bernardy:

Replying to peaceablewhale:

If there is no comment and comment is disabled, the link does not seem to conform to "reference a resource where responses to an entry".

I think one could also argue that pingbacks and trackbacks also qualify as such if listed in the comments list... Let's get a third opinion.

Absolutely, the above quoted RFC:

An Atom link element with a rel attribute value of "replies" may be used to reference a resource where responses to an entry may be found.

Can point to a resource (web-page) where ping and trackbacks only are listed - as those qualify as replies.

The decision what counts could be put in one function which then get's filtered (or even just the filter and foks can add this feature by plugin).

@hakre4 years ago

Make Comments in RSS2 and ATOM feed filterable.

comment:17 @hakre4 years ago

Processing can be controlled by returning a value that evaluates to true or false, filter are named rss2_process_comments and atom_process_comments.

If you take a look into the atom code, it makes use of href="<?php the_permalink_rss() ?>#comments" wich is hardencoded as well with the theme that might differ to that so probably should be filterable as well.

comment:18 @mbijon2 years ago

  • Cc mike@… added

comment:19 @chriscct73 days ago

  • Keywords needs-refresh added
  • Milestone changed from Future Release to 4.4
  • Owner set to chriscct7
  • Priority changed from lowest to normal
  • Severity changed from trivial to normal
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.