<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[11980] trunk: Deprecates the_content_rss().</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/11980">11980</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2009-09-28 14:36:48 +0000 (Mon, 28 Sep 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Deprecates the_content_rss(). Add the_content_feed() and get_the_content_feed(). Convert places that called the_content_rss() with an excerpt length to the_excerpt_rss(). Remove the rss_excerpt_length option. Use the_content_feed() where the_content() was previously used in feeds. Props Viper007Bond.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
<li><a href="#trunkwpincludesdeprecatedphp">trunk/wp-includes/deprecated.php</a></li>
<li><a href="#trunkwpincludesfeedatomphp">trunk/wp-includes/feed-atom.php</a></li>
<li><a href="#trunkwpincludesfeedrdfphp">trunk/wp-includes/feed-rdf.php</a></li>
<li><a href="#trunkwpincludesfeedrssphp">trunk/wp-includes/feed-rss.php</a></li>
<li><a href="#trunkwpincludesfeedrss2php">trunk/wp-includes/feed-rss2.php</a></li>
<li><a href="#trunkwpincludesfeedphp">trunk/wp-includes/feed.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-admin/includes/schema.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -209,7 +209,6 @@
</span><span class="cx">         'require_name_email' => 1,
</span><span class="cx">         'comments_notify' => 1,
</span><span class="cx">         'posts_per_rss' => 10,
</span><del>-        'rss_excerpt_length' => 50,
</del><span class="cx">         'rss_use_excerpt' => 0,
</span><span class="cx">         'mailserver_url' => 'mail.example.com',
</span><span class="cx">         'mailserver_login' => 'login@example.com',
</span><span class="lines">@@ -348,7 +347,7 @@
</span><span class="cx">
</span><span class="cx">         // Delete unused options
</span><span class="cx">         $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts',
</span><del>-                'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed');
</del><ins>+                'page_uris', 'rewrite_rules', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length');
</ins><span class="cx">         foreach ($unusedoptions as $option)
</span><span class="cx">                 delete_option($option);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesdeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/deprecated.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/deprecated.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/deprecated.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -1690,4 +1690,70 @@
</span><span class="cx">         the_author_meta('ID');
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Display the post content for the feed.
+ *
+ * For encoding the html or the $encode_html parameter, there are three possible
+ * values. '0' will make urls footnotes and use make_url_footnote(). '1' will
+ * encode special characters and automatically display all of the content. The
+ * value of '2' will strip all HTML tags from the content.
+ *
+ * Also note that you cannot set the amount of words and not set the html
+ * encoding. If that is the case, then the html encoding will default to 2,
+ * which will strip all HTML tags.
+ *
+ * To restrict the amount of words of the content, you can use the cut
+ * parameter. If the content is less than the amount, then there won't be any
+ * dots added to the end. If there is content left over, then dots will be added
+ * and the rest of the content will be removed.
+ *
+ * @package WordPress
+ * @subpackage Feed
+ * @since 0.71
+ * @uses apply_filters() Calls 'the_content_rss' on the content before processing.
+ * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file
+ *                parameters.
+ *
+ * @deprecated 2.9.0
+ *
+ * @param string $more_link_text Optional. Text to display when more content is available but not displayed.
+ * @param int|bool $stripteaser Optional. Default is 0.
+ * @param string $more_file Optional.
+ * @param int $cut Optional. Amount of words to keep for the content.
+ * @param int $encode_html Optional. How to encode the content.
+ */
+function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
+        _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' );
+        $content = get_the_content($more_link_text, $stripteaser, $more_file);
+        $content = apply_filters('the_content_rss', $content);
+        if ( $cut && !$encode_html )
+                $encode_html = 2;
+        if ( 1== $encode_html ) {
+                $content = esc_html($content);
+                $cut = 0;
+        } elseif ( 0 == $encode_html ) {
+                $content = make_url_footnote($content);
+        } elseif ( 2 == $encode_html ) {
+                $content = strip_tags($content);
+        }
+        if ( $cut ) {
+                $blah = explode(' ', $content);
+                if ( count($blah) > $cut ) {
+                        $k = $cut;
+                        $use_dotdotdot = 1;
+                } else {
+                        $k = count($blah);
+                        $use_dotdotdot = 0;
+                }
+
+                /** @todo Check performance, might be faster to use array slice instead. */
+                for ( $i=0; $i<$k; $i++ )
+                        $excerpt .= $blah[$i].' ';
+                $excerpt .= ($use_dotdotdot) ? '...' : '';
+                $content = $excerpt;
+        }
+        $content = str_replace(']]>', ']]&gt;', $content);
+        echo $content;
+}
+
</ins><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesfeedatomphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed-atom.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed-atom.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/feed-atom.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">                 <?php the_category_rss('atom') ?>
</span><span class="cx">                 <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
</span><span class="cx"> <?php if ( !get_option('rss_use_excerpt') ) : ?>
</span><del>-                <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
</del><ins>+                <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
</ins><span class="cx"> <?php endif; ?>
</span><span class="cx"> <?php atom_enclosure(); ?>
</span><span class="cx"> <?php do_action('atom_entry'); ?>
</span></span></pre></div>
<a id="trunkwpincludesfeedrdfphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed-rdf.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed-rdf.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/feed-rdf.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx"> <?php if (get_option('rss_use_excerpt')) : ?>
</span><span class="cx">         <description><?php the_excerpt_rss() ?></description>
</span><span class="cx"> <?php else : ?>
</span><del>-        <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?></description>
-        <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
</del><ins>+        <description><?php the_excerpt_rss() ?></description>
+        <content:encoded><![CDATA[<?php the_content_feed('rdf') ?>]]></content:encoded>
</ins><span class="cx"> <?php endif; ?>
</span><span class="cx">         <?php do_action('rdf_item'); ?>
</span><span class="cx"> </item>
</span></span></pre></div>
<a id="trunkwpincludesfeedrssphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed-rss.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed-rss.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/feed-rss.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -23,11 +23,7 @@
</span><span class="cx"> <?php while (have_posts()) : the_post(); ?>
</span><span class="cx">         <item>
</span><span class="cx">                 <title><?php the_title_rss() ?></title>
</span><del>-<?php if (get_option('rss_use_excerpt')) { ?>
</del><span class="cx">                 <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
</span><del>-<?php } else { // use content ?>
-                <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description>
-<?php } ?>
</del><span class="cx">                 <link><?php the_permalink_rss() ?></link>
</span><span class="cx">                 <?php do_action('rss_item'); ?>
</span><span class="cx">         </item>
</span></span></pre></div>
<a id="trunkwpincludesfeedrss2php"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed-rss2.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed-rss2.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/feed-rss2.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> <?php else : ?>
</span><span class="cx">                 <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
</span><span class="cx">         <?php if ( strlen( $post->post_content ) > 0 ) : ?>
</span><del>-                <content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
</del><ins>+                <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
</ins><span class="cx">         <?php else : ?>
</span><span class="cx">                 <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
</span><span class="cx">         <?php endif; ?>
</span></span></pre></div>
<a id="trunkwpincludesfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/feed.php (11979 => 11980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/feed.php        2009-09-27 18:54:17 UTC (rev 11979)
+++ trunk/wp-includes/feed.php        2009-09-28 14:36:48 UTC (rev 11980)
</span><span class="lines">@@ -130,69 +130,41 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Display the post content for the feed.
</del><ins>+ * Retrieve the post content for feeds.
</ins><span class="cx"> *
</span><del>- * For encoding the html or the $encode_html parameter, there are three possible
- * values. '0' will make urls footnotes and use make_url_footnote(). '1' will
- * encode special characters and automatically display all of the content. The
- * value of '2' will strip all HTML tags from the content.
- *
- * Also note that you cannot set the amount of words and not set the html
- * encoding. If that is the case, then the html encoding will default to 2,
- * which will strip all HTML tags.
- *
- * To restrict the amount of words of the content, you can use the cut
- * parameter. If the content is less than the amount, then there won't be any
- * dots added to the end. If there is content left over, then dots will be added
- * and the rest of the content will be removed.
- *
</del><span class="cx"> * @package WordPress
</span><span class="cx"> * @subpackage Feed
</span><del>- * @since 0.71
- * @uses apply_filters() Calls 'the_content_rss' on the content before processing.
- * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file
- *                parameters.
</del><ins>+ * @since 2.9.0
+ * @uses apply_filters() Calls 'the_content_feed' on the content before processing.
+ * @see get_the_content()
</ins><span class="cx"> *
</span><del>- * @param string $more_link_text Optional. Text to display when more content is available but not displayed.
- * @param int|bool $stripteaser Optional. Default is 0.
- * @param string $more_file Optional.
- * @param int $cut Optional. Amount of words to keep for the content.
- * @param int $encode_html Optional. How to encode the content.
</del><ins>+ * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
</ins><span class="cx"> */
</span><del>-function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
-        $content = get_the_content($more_link_text, $stripteaser, $more_file);
-        $content = apply_filters('the_content_rss', $content);
-        if ( $cut && !$encode_html )
-                $encode_html = 2;
-        if ( 1== $encode_html ) {
-                $content = esc_html($content);
-                $cut = 0;
-        } elseif ( 0 == $encode_html ) {
-                $content = make_url_footnote($content);
-        } elseif ( 2 == $encode_html ) {
-                $content = strip_tags($content);
-        }
-        if ( $cut ) {
-                $blah = explode(' ', $content);
-                if ( count($blah) > $cut ) {
-                        $k = $cut;
-                        $use_dotdotdot = 1;
-                } else {
-                        $k = count($blah);
-                        $use_dotdotdot = 0;
-                }
</del><ins>+function get_the_content_feed($feed_type = null) {
+        if ( !$feed_type )
+                $feed_type = get_default_feed();
</ins><span class="cx">
</span><del>-                /** @todo Check performance, might be faster to use array slice instead. */
-                for ( $i=0; $i<$k; $i++ )
-                        $excerpt .= $blah[$i].' ';
-                $excerpt .= ($use_dotdotdot) ? '...' : '';
-                $content = $excerpt;
-        }
</del><ins>+        $content = apply_filters('the_content', get_the_content());
</ins><span class="cx">         $content = str_replace(']]>', ']]&gt;', $content);
</span><del>-        echo $content;
</del><ins>+        return apply_filters('the_content_feed', $content, $feed_type);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Display the post content for feeds.
+ *
+ * @package WordPress
+ * @subpackage Feed
+ * @since 2.9.0
+ * @uses apply_filters() Calls 'the_content_feed' on the content before processing.
+ * @see get_the_content()
+ *
+ * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
+ */
+function the_content_feed($feed_type = null) {
+        echo get_the_content_feed();
+}
+
+/**
</ins><span class="cx"> * Display the post excerpt for the feed.
</span><span class="cx"> *
</span><span class="cx"> * @package WordPress
</span></span></pre>
</div>
</div>
</body>
</html>