Added enclosure support.

git-svn-id: https://develop.svn.wordpress.org/trunk@1786 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Donncha O Caoimh
2004-10-12 15:52:29 +00:00
parent 2490a6c2ee
commit 2b105ba050
3 changed files with 71 additions and 20 deletions

View File

@@ -41,6 +41,18 @@ $more = 1;
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
<?php endif; ?>
<wfw:commentRSS><?php echo comments_rss(); ?></wfw:commentRSS>
<?php
$custom_fields = get_post_custom();
if( is_array( $custom_fields ) ) {
while( list( $key, $val ) = each( $custom_fields ) ) {
if( $key == 'enclosure' ) {
$enclosure = $val[ 0 ];
$enclosure = split( "\n", $enclosure );
print "<enclosure url='".trim( $enclosure[ 0 ] )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n";
}
}
}
?>
</item>
<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
</channel>