Opened 2 years ago
#17150 new enhancement
Atom category terms and labels
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Feeds | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
An Atom category supports both machine-facing and human-facing text through its 'term' and 'label' attributes respectively. WordPress Atom template currently outputs category or tag name as the 'term' attribute. I would like to output the category or tag's slug as 'term' and its name as 'label'
Before:
<category scheme="http://wordpress.org/" term="Open Source" />
After:
<category scheme="http://wordpress.org/" term="open-source" label="Open Source" />
Attached is a patch for get_the_category_rss() inside wp-includes/feed.php. I constructed an associative array with slug as the key and name as the value. The slug column is a unique key on the terms table and can also be used to enforce uniqueness in the array.
A possible downside: it's possible two entry categories or tags might have the same name, which would produce two identical outputted lines in RSS 2.0 and RDF feeds while correcting the previous lossy behavior in the Atom feed.

Include proper Atom terms. Move category name to label attribute.