Make WordPress Core

Opened 16 years ago

Last modified 2 months ago

#8828 new enhancement

Tags and Categories are undifferentiable in Atom and RSS feeds

Reported by: znarfor's profile znarfor Owned by:
Milestone: Future Release Priority: low
Severity: minor Version: 2.7
Component: Feeds Keywords: has-patch
Focuses: Cc:

Description (last modified by DrewAPicture)

In RSS feeds this can be achieved using the 'domain' attributes of the category element. This is already done in WordPress export through the wxr_post_taxonomy function, so we just have to do the same in RSS feeds.

In Atom feeds this can be achieved using the 'scheme' attributes of the category element. The Atom standard is not explicit about what to put in this scheme attributes. There is an interesting topic on Edward O’Connor blog. In my proposed patch, i decided to use the 1st representation and i also considered seriously the 2nd.

In the patch, i'm also adding the 'label' attribute to the atom category element and changed the 'term' attribute to be the tag slug. Seems this are currently the best practices in the Atom community.

Attachments (2)

wp-feed-category.diff (2.1 KB) - added by znarfor 16 years ago.
i tried to not modify too much the function to improve the patch readability, but i think this function can be refactorised somehow after.
wp-feed-category-2.diff (2.3 KB) - added by znarfor 15 years ago.
update of my previous patch

Download all attachments as: .zip

Change History (15)

@znarfor
16 years ago

i tried to not modify too much the function to improve the patch readability, but i think this function can be refactorised somehow after.

#1 @znarfor
16 years ago

  • Keywords has-patch added

#2 @peaceablewhale
15 years ago

#9236 attempts to fix the same issue.

#3 @Denis-de-Bernardy
15 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.8 to Future Release

broken patch

#4 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Feeds
  • Owner anonymous deleted

#5 @peaceablewhale
15 years ago

  • Keywords needs-patch removed

This report will be fixed if the patch from #9510 is accepted.

@znarfor
15 years ago

update of my previous patch

#6 @znarfor
15 years ago

  • Cc znarf@… added
  • Keywords has-patch needs-review added
  • Milestone changed from Future Release to 2.9

The patch had been updated for 2.9-rare (trunk).

#7 @janeforshort
15 years ago

  • Milestone changed from 2.9 to Future Release

Lack of community testing on new patch > punting due to being in beta.

#8 @jeremyfelt
11 years ago

  • Keywords needs-refresh added
  • Priority changed from normal to low
  • Severity changed from normal to minor

I was doing something with RSS feeds recently that required the addition of the domain attribute to pass terms from a custom taxonomy. It would be nice if the default taxonomies fell in line with this as well. I would imagine that leaving domain off of categories makes sense, as the element name is <category>. We could add domain="post_tag" to tags that are output in the feed.

I haven't tested the last patch on this ticket, which I'm guessing needs to be reworked a bit. Seems fairly straight forward and the RSS side of things.

#9 @chriscct7
9 years ago

  • Keywords needs-review removed

#10 @stevenkword
7 years ago

  • Keywords good-first-bug added

#11 @DrewAPicture
7 years ago

  • Description modified (diff)
  • Keywords good-first-bug removed

This ticket was mentioned in PR #6935 on WordPress/wordpress-develop by @tw2113.


2 months ago
#12

  • Keywords needs-refresh removed

This code change updates original changes from the trac ticket below, to match the current code from WordPress Trunk. Everything should match what the original patch submitter added, with the exception of switching from attribute_escape() to esc_attr() because of function deprecation.

Trac ticket: See https://core.trac.wordpress.org/ticket/8828

#13 @tw2113
2 months ago

Atom Feed <category> element before:

<category scheme="https://wpcore.test" term="test category" />

Atom Feed <category> element after:

<category scheme="https://wpcore.test/category/" term="test category" label="test category" />

RSS Feed <category> element before:

<category><![CDATA[test category]]></category>

RSS Feed <category> element after:

<category domain="category"><![CDATA[test category]]></category>
Note: See TracTickets for help on using tickets.