WordPress.org

Make WordPress Core

Ticket #5085: generator.diff

File generator.diff, 9.6 KB (added by westi, 11 years ago)

Updated patch

  • wp-includes/default-filters.php

     
    131131add_action('publish_future_post', 'wp_publish_post', 10, 1);
    132132add_action('wp_head', 'noindex', 1);
    133133add_action('wp_head', 'wp_print_scripts');
     134add_action('wp_head', 'wp_generator');
    134135if(!defined('DOING_CRON'))
    135136        add_action('init', 'wp_cron');
    136137add_action('do_feed_rdf', 'do_feed_rdf', 10, 1);
     
    156157add_action('edit_post', 'wp_check_for_changed_slugs');
    157158add_action('edit_form_advanced', 'wp_remember_old_slug');
    158159
    159 ?>
    160  No newline at end of file
     160?>
  • 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 the_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 the_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 the_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 the_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 the_generator( 'rss2' ); ?>
    2424        <?php do_action('commentsrss2_head'); ?>
    2525<?php
    2626if ( have_comments() ) : while ( have_comments() ) : the_comment();
  • wp-includes/general-template.php

     
    10701070        }
    10711071}
    10721072
     1073/**
     1074 * Outputs the XHTML generator that is generated on the wp_head hook.
     1075 */
     1076function wp_generator()
     1077{
     1078        the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) );
     1079}
     1080
     1081/**
     1082 * Outputs the generator XML or Comment for RSS, ATOM, etc.
     1083 * @param {String} $type The type of generator to return.
     1084 */
     1085function the_generator ( $type ) {
     1086        echo apply_filters('the_generator',get_the_generator($type),$type) . "\n";
     1087}
     1088
     1089/**
     1090 * Creates the generator XML or Comment for RSS, ATOM, etc.
     1091 * @param {String} $type The type of generator to return.
     1092 */
     1093function get_the_generator ( $type ) {
     1094        switch ($type) {
     1095                case 'html':
     1096                        $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '">';
     1097                        break;
     1098                case 'xhtml':
     1099                        $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '" />';
     1100                        break;
     1101                case 'atom':
     1102                        $gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress ATOM API</generator>';
     1103                        break;
     1104                case 'rss2':
     1105                        $gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
     1106                        break;
     1107                case 'rdf':
     1108                        $gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
     1109                        break;
     1110                case 'comment':
     1111                        $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
     1112                        break;
     1113        }
     1114        return apply_filters( 'get_the_generator', $gen, $type );
     1115}
    10731116?>
  • 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 the_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 the_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 the_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 the_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 the_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 -->
    10 
    119        <style type="text/css" media="screen">
    1210                @import url( <?php bloginfo('stylesheet_url'); ?> );
    1311        </style>
  • 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 -->
    10 
    119<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    1210<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    1311<link rel="pingback" href="<?php bloginfo('pingback_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 the_generator( 'comment' ); ?>
    1818<opml version="1.0">
    1919        <head>
    2020                <title>Links for <?php echo attribute_escape(get_bloginfo('name', 'display').$cat_name); ?></title>