WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#17149 closed enhancement (fixed)

Allow custom Atom author elements such as email

Reported by: niallkennedy Owned by:
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Feeds Keywords: has-patch
Focuses: Cc:

Description

The Atom Syndication Format includes person constructs to describe a "person, corporation, or similar entity." WordPress builds an author element in its Atom template with support for a 'name' or 'uri' child element only. Publishers may want to include an author's email address but have no way to add in the extra information without editing the core template file.

Publishing an email contact for each author is fairly common in mainstream media to engage readership through their communication method of choice. A feed reader connected to an email client such as Outlook might support responding to an entry via email. My local newspaper, the San Francisco Chronicle, publicly lists the email addresses of its staff with each article.

I am trying to add child elements to the author element, meaning the atom_entry action won't help.

Attached is a patch to build the author person construct as an associative array, pass it to a filter, and echo to screen. Plugins could include additional author data including email or extension elements.

Attachments (1)

atom-author.diff (632 bytes) - added by niallkennedy 3 years ago.
Allow custom author elements such as email by adding an action

Download all attachments as: .zip

Change History (5)

comment:1 westi3 years ago

I think it would be better just to put an action in the feed-atom file for plugins to hook into.

Simpler to use and they can add whatever they like then and it keeps the bulk of the required stuff in the theme file - the current patch makes it possible for a badly written plugin to strip the whole author section out of the feed.

niallkennedy3 years ago

Allow custom author elements such as email by adding an action

comment:2 niallkennedy3 years ago

New attached diff with an 'atom_author' action called before closing the entry's author element.

comment:3 westi3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17641]) Allow custom author elements such as email. Fixes #17149 props niallkennedy.

comment:4 westi3 years ago

  • Milestone changed from Awaiting Review to 3.2
Note: See TracTickets for help on using tickets.