Make WordPress Core


Ignore:
Timestamp:
02/13/2010 04:45:16 PM (17 years ago)
Author:
westi
Message:

Add the generator element in feeds through the {rss2|atom|rdf|rss|opml}_head hooks. Fixes #6947 props sivel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r13068 r13113  
    21312131 * @return string The HTML content for the generator.
    21322132 */
    2133 function get_the_generator( $type ) {
    2134         switch ($type) {
     2133function get_the_generator( $type = '' ) {
     2134        if ( empty( $type ) ) {
     2135
     2136                $current_filter = current_filter();
     2137                if ( empty( $current_filter ) )
     2138                        return;
     2139
     2140                switch ( $current_filter ) {
     2141                        case 'rss2_head' :
     2142                        case 'commentsrss2_head' :
     2143                                $type = 'rss2';
     2144                                break;
     2145                        case 'rss_head' :
     2146                        case 'opml_head' :
     2147                                $type = 'comment';
     2148                                break;
     2149                        case 'rdf_header' :
     2150                                $type = 'rdf';
     2151                                break;
     2152                        case 'atom_head' :
     2153                        case 'comments_atom_head' :
     2154                        case 'app_head' :
     2155                                $type = 'atom';
     2156                                break;
     2157                }
     2158        }
     2159
     2160        switch ( $type ) {
    21352161                case 'html':
    21362162                        $gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
Note: See TracChangeset for help on using the changeset viewer.