WordPress.org

Make WordPress Core

Ticket #5085: wp-generator.patch

File wp-generator.patch, 8.8 KB (added by docwhat, 11 years ago)
  • wp-includes/feed-rss2.php

     
    55?>
    66<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    77
    8 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
     8<?php echo wp_get_generator( 'comment' ); ?>
    99<rss version="2.0"
    1010        xmlns:content="http://purl.org/rss/1.0/modules/content/"
    1111        xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     
    1818        <link><?php bloginfo_rss('url') ?></link>
    1919        <description><?php bloginfo_rss("description") ?></description>
    2020        <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
    21         <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
     21        <?php echo wp_get_generator( 'rss2' ); ?>
    2222        <language><?php echo get_option('rss_language'); ?></language>
    2323        <?php do_action('rss2_head'); ?>
    2424        <?php while( have_posts()) : the_post(); ?>
  • wp-includes/feed-atom.php

     
    1515        <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
    1616
    1717        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated>
    18         <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
     18        <?php echo wp_get_generator( 'atom' ); ?>
    1919
    2020        <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
    2121        <id><?php bloginfo('atom_url'); ?></id>
  • wp-includes/feed-rss2-comments.php

     
    33
    44echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
    55?>
    6 <!-- generator="wordpress/<?php echo $wp_version ?>" -->
     6<?php echo wp_get_generator( 'comment' ); ?>
    77<rss version="2.0"
    88        xmlns:content="http://purl.org/rss/1.0/modules/content/"
    99        xmlns:dc="http://purl.org/dc/elements/1.1/"
     
    2020        <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
    2121        <description><?php bloginfo_rss("description") ?></description>
    2222        <pubDate><?php echo gmdate('r'); ?></pubDate>
    23         <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
     23        <?php echo wp_get_generator( 'rss2' ); ?>
    2424        <?php do_action('commentsrss2_head'); ?>
    2525<?php
    2626if ( have_comments() ) : while ( have_comments() ) : the_comment();
  • wp-includes/functions.php

     
    14161416        while ( @ob_end_flush() );
    14171417}
    14181418
     1419/**
     1420 * Creates the generator XML/Comment for RSS, ATOM, etc.
     1421 * @param {String} $type The type of XML to generate.
     1422 */
     1423function wp_get_generator ( $type='comment' ) {
     1424    switch ($type) {
     1425    case 'html':
     1426        $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '">';
     1427        break;
     1428    case 'xhtml':
     1429        $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '" />';
     1430        break;
     1431    case 'atom':
     1432        $gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
     1433        break;
     1434    case 'rss2':
     1435        $gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
     1436        break;
     1437    case 'rdf':
     1438        $gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
     1439        break;
     1440    default: // case 'comment':
     1441        $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
     1442        break;
     1443    }
     1444
     1445    return apply_filters( 'wp_get_generator', $gen );
     1446}
     1447
    14191448?>
  • wp-includes/feed-rss.php

     
    44
    55?>
    66<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    7 <!-- generator="wordpress/<?php echo $wp_version ?>" -->
     7<?php echo wp_get_generator( 'comment' ); ?>
    88<rss version="0.92">
    99<channel>
    1010        <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
  • wp-includes/feed-rdf.php

     
    44
    55?>
    66<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
    7 <!-- generator="wordpress/<?php echo $wp_version ?>" -->
     7<?php echo wp_get_generator( 'comment' ); ?>
    88<rdf:RDF
    99        xmlns="http://purl.org/rss/1.0/"
    1010        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     
    1919        <link><?php bloginfo_rss('url') ?></link>
    2020        <description><?php bloginfo_rss('description') ?></description>
    2121        <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
    22         <admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
     22        <?php echo wp_get_generator( 'rdf' ); ?>
    2323        <sy:updatePeriod>hourly</sy:updatePeriod>
    2424        <sy:updateFrequency>1</sy:updateFrequency>
    2525        <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
  • wp-includes/feed-atom-comments.php

     
    1818        <subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
    1919
    2020        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
    21         <generator uri="http://wordpress.org/" version="<?php bloginfo('version'); ?>">WordPress</generator>
     21        <?php echo wp_get_generator( 'atom' ); ?>
    2222
    2323        <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
    2424        <link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
  • wp-app.php

     
    739739<link rel="last" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($last_page) ?>" />
    740740<link rel="self" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($self_page) ?>" />
    741741<rights type="text">Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></rights>
    742 <generator uri="http://wordpress.com/" version="1.0.5-dc">WordPress.com Atom API</generator>
     742                                                                                <?php echo wp_get_generator( 'atom' ); ?>
    743743<?php if ( have_posts() ) {
    744744                        while ( have_posts() ) {
    745745                                the_post();
  • wp-content/themes/classic/header.php

     
    66
    77        <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
    88
    9         <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
     9        <?php echo wp_get_generator( 'xhtml' ); ?>
    1010
    1111        <style type="text/css" media="screen">
    1212                @import url( <?php bloginfo('stylesheet_url'); ?> );
  • wp-content/themes/default/header.php

     
    66
    77<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    88
    9 <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
     9<?php echo wp_get_generator('xhtml'); ?>
    1010
    1111<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    1212<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
  • wp-links-opml.php

     
    1414        $link_cat = intval($link_cat);
    1515}
    1616?><?php echo '<?xml version="1.0"?'.">\n"; ?>
    17 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
     17<?php echo wp_get_generator( 'comment' ); ?>
    1818<opml version="1.0">
    1919        <head>
    2020                <title>Links for <?php echo attribute_escape(get_bloginfo('name', 'display').$cat_name); ?></title>