Use the_content_feed() when looking for zero-length post content for RSS2 feeds. Now you can have blank posts with content generated by the_content filters. props SergeyBiryukov. fixes #15604

git-svn-id: http://core.svn.wordpress.org/trunk@21235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2012-07-09 03:33:01 +00:00
parent ecea277a8a
commit 87125fe8b5
1 changed files with 6 additions and 5 deletions

View File

@ -41,13 +41,14 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<guid isPermaLink="false"><?php the_guid(); ?></guid> <guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?> <?php if (get_option('rss_use_excerpt')) : ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description> <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
<?php else : ?> <?php else : ?>
<description><![CDATA[<?php the_excerpt_rss() ?>]]></description> <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
<?php if ( strlen( $post->post_content ) > 0 ) : ?> <?php $content = get_the_content_feed('rss2'); ?>
<content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded> <?php if ( strlen( $content ) > 0 ) : ?>
<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
<?php else : ?> <?php else : ?>
<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded> <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss> <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>