Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#6947 closed enhancement (fixed)

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

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

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 17 years ago.
Move the generator output to *_head actions for feeds
6947.2.diff​ (6.7 KB ) - added by sivel 17 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
18 years ago

I agree. Let's see the patch!

#2 @gnot
18 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
18 years ago

  • Owner changed from anonymous to ryan

#4 @matt
18 years ago

  • Milestone 2.7 → 2.9

#5 @DD32
18 years ago

  • Component General → Feeds
  • Keywords needs-patch added

#6 @FFEMTcJ
18 years ago

  • Milestone 2.9 → Future Release

#7 @Denis-de-Bernardy
17 years ago

  • Milestone Future Release
  • Resolution → wontfix
  • Status new → closed

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

#8 @DD32
17 years ago

  • Milestone → Future Release
  • Resolution wontfix
  • Status closed → 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
17 years ago

Move the generator output to *_head actions for feeds

#9 @sivel
17 years ago

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

@sivel
17 years ago

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

#10 @westi
17 years ago

  • Owner changed from ryan to westi
  • Status reopened → 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
17 years ago

  • Resolution → fixed
  • Status accepted → 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.