WordPress.org

Make WordPress Core

Ticket #1526: wp-atom.php.2.diff

File wp-atom.php.2.diff, 3.0 KB (added by markjaquith, 16 years ago)

Patch against 1.6 SVN

  • wp-atom.php

     
    11<?php
    22
    3 if (empty($wp)) {
     3if (empty($feed)) {
    44        require_once('wp-config.php');
    55        wp('feed=atom');
    66}
     
    1010
    1111?>
    1212<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
    13 <feed version="0.3"
    14   xmlns="http://purl.org/atom/ns#"
     13<feed
     14  xmlns="http://www.w3.org/2005/Atom"
    1515  xmlns:dc="http://purl.org/dc/elements/1.1/"
    1616  xml:lang="<?php echo get_option('rss_language'); ?>"
    1717  <?php do_action('atom_ns'); ?>
    1818  >
    1919        <title><?php bloginfo_rss('name') ?></title>
    2020        <link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
    21         <tagline><?php bloginfo_rss("description") ?></tagline>
    22         <modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified>
    23         <copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright>
    24         <generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
     21        <link rel="self" type="application/atom+xml" href="<?php bloginfo('atom_url') ?>" />
     22        <subtitle><?php bloginfo_rss("description") ?></subtitle>
     23        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
     24        <rights>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></rights>
     25        <id><?php bloginfo('url') ?></id>
     26        <generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
    2527        <?php do_action('atom_head'); ?>
    2628        <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    2729        <entry>
    2830                <author>
    2931                        <name><?php the_author() ?></name>
    3032                </author>
    31                 <title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
     33                <title type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><![CDATA[<?php the_title_rss() ?>]]></div></title>
    3234                <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
    3335                <id><?php the_guid(); ?></id>
    34                 <modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified>
    35                 <issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued>
     36                <updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated>
    3637                <?php the_category_rss('rdf') ?>
    37                 <summary type="text/plain" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
     38                <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><![CDATA[<?php the_excerpt_rss(); ?>]]></div></summary>
    3839<?php if ( !get_settings('rss_use_excerpt') ) : ?>
    39                 <content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
     40                <content type="xhtml" xml:base="<?php permalink_single_rss() ?>"><div xmlns="http://www.w3.org/1999/xhtml"><![CDATA[<?php the_content('', 0, '') ?>]]></div></content>
    4041<?php endif; ?>
    4142<?php rss_enclosure(); ?>
    4243<?php do_action('atom_entry'); ?>