From d8490aeea2dd20ac55e007f13372a728f0d92cf7 Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 13 Feb 2010 16:45:16 +0000 Subject: [PATCH] Add the generator element in feeds through the {rss2|atom|rdf|rss|opml}_head hooks. Fixes #6947 props sivel. git-svn-id: http://svn.automattic.com/wordpress/trunk@13113 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-app.php | 1 - wp-includes/default-filters.php | 5 +++++ wp-includes/feed-atom-comments.php | 1 - wp-includes/feed-atom.php | 1 - wp-includes/feed-rdf.php | 1 - wp-includes/feed-rss.php | 1 - wp-includes/feed-rss2-comments.php | 1 - wp-includes/feed-rss2.php | 1 - wp-includes/general-template.php | 30 ++++++++++++++++++++++++++++-- wp-links-opml.php | 2 +- 10 files changed, 34 insertions(+), 10 deletions(-) diff --git a/wp-app.php b/wp-app.php index 6504d7080..88938c2f6 100644 --- a/wp-app.php +++ b/wp-app.php @@ -1096,7 +1096,6 @@ EOD; Copyright - ' - diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index e08ba658f..cce1cbfb7 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -20,7 +20,6 @@ echo ''; ?> - diff --git a/wp-includes/feed-rdf.php b/wp-includes/feed-rdf.php index 5a7b69449..3a0daf1fd 100644 --- a/wp-includes/feed-rdf.php +++ b/wp-includes/feed-rdf.php @@ -23,7 +23,6 @@ echo ''; ?> - 2000-01-01T12:00+00:00 diff --git a/wp-includes/feed-rss.php b/wp-includes/feed-rss.php index 90eeab05e..b26897d3e 100644 --- a/wp-includes/feed-rss.php +++ b/wp-includes/feed-rss.php @@ -9,7 +9,6 @@ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_opt $more = 1; echo ''; ?> - <?php bloginfo_rss('name'); wp_title_rss(); ?> diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index 8232a0f17..74715b80e 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -29,7 +29,6 @@ echo ''; - diff --git a/wp-includes/feed-rss2.php b/wp-includes/feed-rss2.php index 12286da28..e97ddd5b9 100644 --- a/wp-includes/feed-rss2.php +++ b/wp-includes/feed-rss2.php @@ -26,7 +26,6 @@ echo ''; ?> - diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index f6fc51af3..545c780bd 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2130,8 +2130,34 @@ function the_generator( $type ) { * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export). * @return string The HTML content for the generator. */ -function get_the_generator( $type ) { - switch ($type) { +function get_the_generator( $type = '' ) { + if ( empty( $type ) ) { + + $current_filter = current_filter(); + if ( empty( $current_filter ) ) + return; + + switch ( $current_filter ) { + case 'rss2_head' : + case 'commentsrss2_head' : + $type = 'rss2'; + break; + case 'rss_head' : + case 'opml_head' : + $type = 'comment'; + break; + case 'rdf_header' : + $type = 'rdf'; + break; + case 'atom_head' : + case 'comments_atom_head' : + case 'app_head' : + $type = 'atom'; + break; + } + } + + switch ( $type ) { case 'html': $gen = ''; break; diff --git a/wp-links-opml.php b/wp-links-opml.php index e033d4989..8f8040375 100644 --- a/wp-links-opml.php +++ b/wp-links-opml.php @@ -26,11 +26,11 @@ if ((empty ($link_cat)) || ($link_cat == 'all') || ($link_cat == '0')) { $link_cat = intval($link_cat); } ?>\n"; ?> - Links for <?php echo esc_attr(get_bloginfo('name', 'display').$cat_name); ?> GMT +