mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Add the generator element in feeds through the {rss2|atom|rdf|rss|opml}_head hooks. Fixes #6947 props sivel.
git-svn-id: https://develop.svn.wordpress.org/trunk@13113 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user