WordPress.org

Make WordPress Core

Changeset 6195


Ignore:
Timestamp:
10/06/07 06:55:24 (7 years ago)
Author:
westi
Message:

Centralise generator generation, move theme generator generation to wp-head hook. Fixes #5085, #4803. props docwhat, Viper007Bond.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/export.php

    r6156 r6195  
    182182<!--    contained in this file into your blog --> 
    183183 
    184 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:i'); ?>"--> 
     184<?php the_generator('export');?> 
    185185<rss version="2.0" 
    186186    xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  • trunk/wp-app.php

    r6125 r6195  
    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() ) { 
  • trunk/wp-content/themes/classic/header.php

    r4757 r6195  
    66 
    77    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> 
    8  
    9     <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please --> 
    108 
    119    <style type="text/css" media="screen"> 
  • trunk/wp-content/themes/default/header.php

    r5062 r6195  
    66 
    77<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title> 
    8  
    9 <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats --> 
    108 
    119<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> 
  • trunk/wp-includes/default-filters.php

    r6192 r6195  
    142142add_action('wp_head', 'noindex', 1); 
    143143add_action('wp_head', 'wp_print_scripts'); 
     144add_action('wp_head', 'wp_generator'); 
    144145if(!defined('DOING_CRON')) 
    145146    add_action('init', 'wp_cron'); 
  • trunk/wp-includes/feed-atom-comments.php

    r6026 r6195  
    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'); ?>" /> 
  • trunk/wp-includes/feed-atom.php

    r6093 r6195  
    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') ?>" /> 
  • trunk/wp-includes/feed-rdf.php

    r5910 r6195  
    55?> 
    66<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
    7 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 
    87<rdf:RDF 
    98    xmlns="http://purl.org/rss/1.0/" 
     
    2019    <description><?php bloginfo_rss('description') ?></description> 
    2120    <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 ?>"/> 
     21    <?php the_generator( 'rdf' ); ?> 
    2322    <sy:updatePeriod>hourly</sy:updatePeriod> 
    2423    <sy:updateFrequency>1</sy:updateFrequency> 
  • trunk/wp-includes/feed-rss.php

    r5910 r6195  
    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> 
  • trunk/wp-includes/feed-rss2-comments.php

    r6026 r6195  
    44echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; 
    55?> 
    6 <!-- generator="wordpress/<?php echo $wp_version ?>" --> 
    76<rss version="2.0" 
    87    xmlns:content="http://purl.org/rss/1.0/modules/content/" 
     
    2120    <description><?php bloginfo_rss("description") ?></description> 
    2221    <pubDate><?php echo gmdate('r'); ?></pubDate> 
    23     <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> 
     22    <?php the_generator( 'rss2' ); ?> 
    2423    <?php do_action('commentsrss2_head'); ?> 
    2524<?php 
  • trunk/wp-includes/feed-rss2.php

    r5910 r6195  
    66<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
    77 
    8 <!-- generator="wordpress/<?php bloginfo_rss('version') ?>" --> 
    98<rss version="2.0" 
    109    xmlns:content="http://purl.org/rss/1.0/modules/content/" 
     
    1918    <description><?php bloginfo_rss("description") ?></description> 
    2019    <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> 
     20    <?php the_generator( 'rss2' ); ?> 
    2221    <language><?php echo get_option('rss_language'); ?></language> 
    2322    <?php do_action('rss2_head'); ?> 
  • trunk/wp-includes/general-template.php

    r6192 r6195  
    10761076} 
    10771077 
     1078/** 
     1079 * Outputs the XHTML generator that is generated on the wp_head hook. 
     1080 */ 
     1081function wp_generator() 
     1082{ 
     1083    the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); 
     1084} 
     1085 
     1086/** 
     1087 * Outputs the generator XML or Comment for RSS, ATOM, etc. 
     1088 * @param {String} $type The type of generator to return. 
     1089 */ 
     1090function the_generator ( $type ) { 
     1091    echo apply_filters('the_generator',get_the_generator($type),$type) . "\n"; 
     1092} 
     1093 
     1094/** 
     1095 * Creates the generator XML or Comment for RSS, ATOM, etc. 
     1096 * @param {String} $type The type of generator to return. 
     1097 */ 
     1098function get_the_generator ( $type ) { 
     1099    switch ($type) { 
     1100        case 'html': 
     1101            $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '">'; 
     1102            break; 
     1103        case 'xhtml': 
     1104            $gen = '<meta name="generator" content="WordPress/' . get_bloginfo( 'version' ) . '" />'; 
     1105            break; 
     1106        case 'atom': 
     1107            $gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>'; 
     1108            break; 
     1109        case 'rss2': 
     1110            $gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>'; 
     1111            break; 
     1112        case 'rdf': 
     1113            $gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />'; 
     1114            break; 
     1115        case 'comment': 
     1116            $gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->'; 
     1117            break; 
     1118        case 'export': 
     1119            $gen = '<!-- generator="wordpress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '"-->'; 
     1120            break; 
     1121    } 
     1122    return apply_filters( "get_the_generator_{$type}", $gen, $type ); 
     1123} 
    10781124?> 
  • trunk/wp-links-opml.php

    r6160 r6195  
    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> 
Note: See TracChangeset for help on using the changeset viewer.