Make WordPress Core

Opened 17 years ago

Closed 15 years ago

#6947 closed enhancement (fixed)

Add the Generator element in feeds through the {rss2|atom|rdf|rss}_head hook

Reported by: gnot's profile gnot Owned by: westi's profile westi
Milestone: 3.0 Priority: low
Severity: minor Version: 2.5.1
Component: Feeds Keywords: has-patch
Focuses: Cc:

Description

The generator metatag is added to the HTML pages through the wp_head() hook.

I think it would be more useful to do the same in the feeds. The generator element could be added through the {rss2|atom|rdf|rss}_head hook.

This way it would be easier for plugin authors to totally remove the generator tags for security reasons or make modifications to the generator string.

Attachments (2)

6947.diff (5.4 KB) - added by sivel 15 years ago.
Move the generator output to *_head actions for feeds
6947.2.diff (6.7 KB) - added by sivel 15 years ago.
Move the generator output to *_head actions for feeds, opml and app. Add opml_head action.

Download all attachments as: .zip

Change History (13)

#1 @markjaquith
17 years ago

I agree. Let's see the patch!

#2 @gnot
17 years ago

If you guys 'n' gals expect this patch from me, you may check this ticket again after a few months, since this requires knowledge I do not currently have :)

#3 @ryan
17 years ago

  • Owner changed from anonymous to ryan

#4 @matt
16 years ago

  • Milestone changed from 2.7 to 2.9

#5 @DD32
16 years ago

  • Component changed from General to Feeds
  • Keywords needs-patch added

#6 @FFEMTcJ
16 years ago

  • Milestone changed from 2.9 to Future Release

#7 @Denis-de-Bernardy
16 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

filtering on the_generator gets the job done already: It contains the context.

#8 @DD32
16 years ago

  • Milestone set to Future Release
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Sounds like a good idea to me.

The ticket isnt just about being able to remove it easily, Its about cleaner code.

It would however need a helper function, since its impossible to pass params via add_action (ie. add_action('rss_head', 'the_generator("rss")');)

@sivel
15 years ago

Move the generator output to *_head actions for feeds

#9 @sivel
15 years ago

  • Cc matt@… added
  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 3.0

@sivel
15 years ago

Move the generator output to *_head actions for feeds, opml and app. Add opml_head action.

#10 @westi
15 years ago

  • Owner changed from ryan to westi
  • Status changed from reopened to accepted

This looks great.

I really like the way you use current_filter to determine the context for the actions :-)

Hadn't thought of doing it that way.

#11 @westi
15 years ago

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

(In [13113]) Add the generator element in feeds through the {rss2|atom|rdf|rss|opml}_head hooks. Fixes #6947 props sivel.

Note: See TracTickets for help on using tickets.