Code cleanup: wp-includes/feed.php

git-svn-id: http://svn.automattic.com/wordpress/trunk@4393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2006-10-13 13:49:39 +00:00
parent cd5cb736ec
commit 6c7037a96d

View File

@ -23,15 +23,14 @@ function the_title_rss() {
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) {
if ( $cut && !$encode_html )
$encode_html = 2;
}
if ($encode_html == 1) {
if ( 1== $encode_html ) {
$content = wp_specialchars($content);
$cut = 0;
} elseif ($encode_html == 0) {
} elseif ( 0 == $encode_html ) {
$content = make_url_footnote($content);
} elseif ($encode_html == 2) {
} elseif ( 2 == $encode_html ) {
$content = strip_tags($content);
}
if ( $cut ) {
@ -108,7 +107,8 @@ function get_author_rss_link($echo = false, $author_id, $author_nicename) {
$link = apply_filters('author_feed_link', $link);
if ($echo) echo $link;
if ( $echo )
echo $link;
return $link;
}
@ -124,21 +124,21 @@ function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
$link = apply_filters('category_feed_link', $link);
if ($echo) echo $link;
if ( $echo )
echo $link;
return $link;
}
function get_the_category_rss($type = 'rss') {
$categories = get_the_category();
$the_list = '';
foreach ($categories as $category) {
foreach ( (array) $categories as $category ) {
$category->cat_name = convert_chars($category->cat_name);
if ('rdf' == $type) {
if ( 'rdf' == $type )
$the_list .= "\n\t\t<dc:subject>$category->cat_name</dc:subject>\n";
} else {
else
$the_list .= "\n\t\t<category>$category->cat_name</category>\n";
}
}
return apply_filters('the_category_rss', $the_list, $type);
}
@ -148,14 +148,15 @@ function the_category_rss($type = 'rss') {
function rss_enclosure() {
global $id, $post;
if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return;
if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
return;
$custom_fields = get_post_custom();
if ( is_array($custom_fields) ) {
while ( list($key, $val) = each($custom_fields) ) {
if ( $key == 'enclosure' ) {
if ( is_array($val) ) {
foreach($val as $enc) {
foreach ( (array) $val as $enc ) {
$enclosure = split( "\n", $enc );
print "<enclosure url='".trim( htmlspecialchars($enclosure[ 0 ]) )."' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n";
}