Make WordPress Core

Ticket #14363: 14363.patch

File 14363.patch, 7.0 KB (added by peaceablewhale, 14 years ago)
  • wp-includes/feed-atom.php

     
    2121
    2222        <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
    2323
    24         <link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
    25         <id><?php bloginfo('atom_url'); ?></id>
     24        <link rel="alternate" href="<?php bloginfo_rss('url') ?>" />
     25        <id><?php bloginfo_rss('atom_url'); ?></id>
    2626        <link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
    2727
    2828        <?php do_action('atom_head'); ?>
     
    3535                        <?php endif;
    3636                        do_action('atom_author'); ?>
    3737                </author>
    38                 <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
    39                 <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" />
     38                <title><?php the_title_rss() ?></title>
     39                <link rel="alternate" href="<?php the_permalink_rss() ?>" />
    4040                <id><?php the_guid() ; ?></id>
    4141                <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
    4242                <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
    4343                <?php the_category_rss('atom') ?>
    44                 <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
     44                <summary type="<?php html_type_rss(); ?>"><?php the_excerpt_feed('atom'); ?></summary>
    4545<?php if ( !get_option('rss_use_excerpt') ) : ?>
    46                 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
     46                <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><?php the_content_feed('atom'); ?></content>
    4747<?php endif; ?>
    4848<?php atom_enclosure(); ?>
    4949<?php do_action('atom_entry'); ?>
    50                 <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
     50                <link rel="replies" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
    5151                <link rel="replies" type="application/atom+xml" href="<?php echo get_post_comments_feed_link(0,'atom') ?>" thr:count="<?php echo get_comments_number()?>"/>
    5252                <thr:total><?php echo get_comments_number()?></thr:total>
    5353        </entry>
  • wp-includes/feed.php

     
    145145                $feed_type = get_default_feed();
    146146
    147147        $content = apply_filters('the_content', get_the_content());
    148         $content = str_replace(']]>', ']]&gt;', $content);
     148        if ($feed_type == 'atom') {
     149                if (strpos(get_bloginfo('html_type'), 'xhtml') !== false) {
     150                        $content = '<div xmlns="http://www.w3.org/1999/xhtml">' . $content . '</div>';
     151                }
     152                else {
     153                        $content = '<![CDATA[' . $content . ']]>';
     154                }
     155        }
    149156        return apply_filters('the_content_feed', $content, $feed_type);
    150157}
    151158
     
    165172}
    166173
    167174/**
    168  * Display the post excerpt for the feed.
     175 * Display the post excerpt for the feeds.
    169176 *
    170177 * @package WordPress
    171178 * @subpackage Feed
    172  * @since 0.71
     179 * @since 3.2.0
    173180 * @uses apply_filters() Calls 'the_excerpt_rss' hook on the excerpt.
     181 * @uses apply_filters() Calls 'the_excerpt_feed' hook on the excerpt.
     182 *
     183 * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
    174184 */
    175 function the_excerpt_rss() {
    176         $output = get_the_excerpt();
    177         echo apply_filters('the_excerpt_rss', $output);
     185function the_excerpt_feed($feed_type = null) {
     186        if ( !$feed_type )
     187                $feed_type = get_default_feed();
     188               
     189        $output = apply_filters('the_excerpt_rss', get_the_excerpt());
     190        if ($feed_type == 'atom') {
     191                if (strpos(get_bloginfo('html_type'), 'xhtml') !== false) {
     192                        $output = '<div xmlns="http://www.w3.org/1999/xhtml">' . $output . '</div>';
     193                }
     194                else {
     195                        $output = '<![CDATA[' . $output . ']]>';
     196                }
     197        }
     198        echo apply_filters('the_excerpt_feed', $output, $feed_type);
    178199}
    179200
    180201/**
  • wp-includes/feed-rss2.php

     
    4141
    4242                <guid isPermaLink="false"><?php the_guid(); ?></guid>
    4343<?php if (get_option('rss_use_excerpt')) : ?>
    44                 <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
     44                <description><![CDATA[<?php the_excerpt_feed('rss2') ?>]]></description>
    4545<?php else : ?>
    46                 <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
     46                <description><![CDATA[<?php the_excerpt_feed('rss2') ?>]]></description>
    4747        <?php if ( strlen( $post->post_content ) > 0 ) : ?>
    4848                <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
    4949        <?php else : ?>
    50                 <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
     50                <content:encoded><![CDATA[<?php the_excerpt_feed('rss2') ?>]]></content:encoded>
    5151        <?php endif; ?>
    5252<?php endif; ?>
    5353                <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
  • wp-includes/feed-rdf.php

     
    4343        <dc:creator><?php the_author() ?></dc:creator>
    4444        <?php the_category_rss('rdf') ?>
    4545<?php if (get_option('rss_use_excerpt')) : ?>
    46         <description><?php the_excerpt_rss() ?></description>
     46        <description><?php the_excerpt_feed('rdf') ?></description>
    4747<?php else : ?>
    48         <description><?php the_excerpt_rss() ?></description>
     48        <description><?php the_excerpt_feed('rdf') ?></description>
    4949        <content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
    5050<?php endif; ?>
    5151        <?php do_action('rdf_item'); ?>
  • wp-includes/feed-rss.php

     
    2222<?php while (have_posts()) : the_post(); ?>
    2323        <item>
    2424                <title><?php the_title_rss() ?></title>
    25                 <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
     25                <description><![CDATA[<?php the_excerpt_feed('rss') ?>]]></description>
    2626                <link><?php the_permalink_rss() ?></link>
    2727                <?php do_action('rss_item'); ?>
    2828        </item>
  • wp-includes/deprecated.php

     
    25852585}
    25862586
    25872587/**
     2588 * Display the post excerpt for the feed.
     2589 *
     2590 * @package WordPress
     2591 * @subpackage Feed
     2592 * @since 0.71
     2593 * @deprecated 3.2.0
     2594 * @deprecated Use the_excerpt_feed()
     2595 * @see the_excerpt_feed()
     2596 */
     2597function the_excerpt_rss() {
     2598        _deprecated_function( __FUNCTION__, '3.2', 'the_excerpt_feed' );
     2599        the_excerpt_feed('rss');
     2600}
     2601
     2602/**
    25882603 * Update the categories cache.
    25892604 *
    25902605 * This function does not appear to be used anymore or does not appear to be