WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 5 years ago

#19017 closed defect (bug) (fixed)

No way to add XSL to Feeds

Reported by: pathawks Owned by: SergeyBiryukov
Milestone: 4.0 Priority: normal
Severity: minor Version: 3.2.1
Component: Feeds Keywords: has-patch commit
Focuses: Cc:

Description

To add XSL to a feed, for nicer display of feeds in browser, a line needs to be inserted before the root RSS tag.
For a plugin to add the correct code, there should be an action between <?xml?> and <rss>`
Perhaps something like <?php do_action('rss2_xsl'); ?> on line 12 of feed-rss2.php?

Attachments (3)

19017.diff (2.9 KB) - added by solarissmoke 8 years ago.
Add an action after the XML declaration in feeds to allow the insertion of style information (and anything else)
19017.2.diff (3.5 KB) - added by wonderboymusic 5 years ago.
19017.3.diff (4.0 KB) - added by DrewAPicture 5 years ago.
docs + single hook with context

Download all attachments as: .zip

Change History (10)

#1 @solarissmoke
8 years ago

FWIW there are a few plugins out there that do this sort of thing, e.g., Advanced RSS. But if a new action is added, I think it should be more generic and future-proof - something like rss_pre, maybe.

#2 follow-up: @pathawks
8 years ago

Correct me if I'm wrong, but it looks like Advanced RSS is only a styled RSS widget that you can include in your sidebar.

I am looking for something that will change the way a site's feed will look when viewed in a browser, similar to Feedburner's 'BrowserFriendly' option.

#3 in reply to: ↑ 2 @solarissmoke
8 years ago

  • Keywords has-patch added; needs-patch removed

Replying to pathawks:

Correct me if I'm wrong, but it looks like Advanced RSS is only a styled RSS widget that you can include in your sidebar.

Sorry, my mistake.

Attaching at patch that adds a pre action to the various feeds.

@solarissmoke
8 years ago

Add an action after the XML declaration in feeds to allow the insertion of style information (and anything else)

#4 @wonderboymusic
5 years ago

#24534 was marked as a duplicate.

#5 @wonderboymusic
5 years ago

  • Keywords needs-docs easy added
  • Milestone changed from Awaiting Review to 4.0

Refreshed - needs docs for hooks

@DrewAPicture
5 years ago

docs + single hook with context

#6 @DrewAPicture
5 years ago

  • Keywords commit added; needs-docs easy removed

19017.3.diff leverages a single hook, rss_tag_pre, passing context for the various types of feeds and adds hook docs.

#7 @SergeyBiryukov
5 years ago

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

In 29014:

Introduce 'rss_tag_pre' action, which fires between the xml and rss tags in a feed.

props solarissmoke, wonderboymusic, DrewAPicture.
fixes #19017.

Note: See TracTickets for help on using tickets.