Make WordPress Core

Changeset 13113


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

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

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r13054 r13113  
    10971097<link rel="self" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($self_page) ?>" />
    10981098<rights type="text">Copyright <?php echo date('Y'); ?></rights>
    1099 <?php the_generator( 'atom' ); ?>
    11001099<?php do_action('app_head'); ?>
    11011100<?php if ( have_posts() ) {
  • trunk/wp-includes/default-filters.php

    r12982 r13113  
    185185add_action( 'wp_head',             'rel_canonical'                        );
    186186add_action( 'wp_footer',           'wp_print_footer_scripts'              );
     187
     188// Feed Generator Tags
     189foreach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) {
     190    add_action( $action, 'the_generator' );
     191}
    187192
    188193// WP Cron
  • trunk/wp-includes/feed-atom-comments.php

    r12789 r13113  
    2626
    2727    <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT'), false); ?></updated>
    28     <?php the_generator( 'atom' ); ?>
    2928
    3029<?php if ( is_singular() ) { ?>
  • trunk/wp-includes/feed-atom.php

    r12587 r13113  
    2121
    2222    <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
    23     <?php the_generator( 'atom' ); ?>
    2423
    2524    <link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
  • trunk/wp-includes/feed-rdf.php

    r13002 r13113  
    2424    <description><?php bloginfo_rss('description') ?></description>
    2525    <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
    26     <?php the_generator( 'rdf' ); ?>
    2726    <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    2827    <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
  • trunk/wp-includes/feed-rss.php

    r11980 r13113  
    1010
    1111echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    12 <?php the_generator( 'comment' ); ?>
    1312<rss version="0.92">
    1413<channel>
  • trunk/wp-includes/feed-rss2-comments.php

    r11358 r13113  
    3030    <description><?php bloginfo_rss("description") ?></description>
    3131    <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
    32     <?php the_generator( 'rss2' ); ?>
    3332    <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    3433    <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
  • trunk/wp-includes/feed-rss2.php

    r11980 r13113  
    2727    <description><?php bloginfo_rss("description") ?></description>
    2828    <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
    29     <?php the_generator( 'rss2' ); ?>
    3029    <language><?php echo get_option('rss_language'); ?></language>
    3130    <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
  • 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' ) . '">';
  • trunk/wp-links-opml.php

    r12515 r13113  
    2727}
    2828?><?php echo '<?xml version="1.0"?'.">\n"; ?>
    29 <?php the_generator( 'comment' ); ?>
    3029<opml version="1.0">
    3130    <head>
    3231        <title>Links for <?php echo esc_attr(get_bloginfo('name', 'display').$cat_name); ?></title>
    3332        <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated>
     33        <?php do_action('opml_head'); ?>
    3434    </head>
    3535    <body>
Note: See TracChangeset for help on using the changeset viewer.