Deprecate permalink_single_rss(). Add the_permalink_rss() with accompanying filter. Props joostdevalk and Otto42. fixes #4654

git-svn-id: http://svn.automattic.com/wordpress/trunk@5910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-21 18:27:45 +00:00
parent d3754cc69b
commit 9b395107f4
9 changed files with 78 additions and 74 deletions

View File

@ -25,7 +25,7 @@ require_once ('admin-header.php');
<select name="author"> <select name="author">
<option value="all" selected="selected"><?php _e('All'); ?></option> <option value="all" selected="selected"><?php _e('All'); ?></option>
<?php <?php
$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" ); $authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
foreach ( $authors as $id ) { foreach ( $authors as $id ) {
$o = get_userdata( $id ); $o = get_userdata( $id );
echo "<option value='$o->ID'>$o->display_name</option>"; echo "<option value='$o->ID'>$o->display_name</option>";
@ -131,9 +131,9 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
?> ?>
<!-- <!--
This is a WordPress eXtended RSS file generated by WordPress as an export of This is a WordPress eXtended RSS file generated by WordPress as an export of
your blog. It contains information about your blog's posts, comments, and your blog. It contains information about your blog's posts, comments, and
categories. You may use this file to transfer that content from one site to categories. You may use this file to transfer that content from one site to
another. This file is not intended to serve as a complete backup of your another. This file is not intended to serve as a complete backup of your
blog. blog.
@ -143,10 +143,10 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
2. Go to Manage > Import in the blog's admin. 2. Go to Manage > Import in the blog's admin.
3. Choose "WordPress" from the list of importers. 3. Choose "WordPress" from the list of importers.
4. Upload this file using the form provided on that page. 4. Upload this file using the form provided on that page.
5. You will first be asked to map the authors in this export file to users 5. You will first be asked to map the authors in this export file to users
on the blog. For each author, you may choose to map an existing user on on the blog. For each author, you may choose to map an existing user on
the blog or to create a new user. the blog or to create a new user.
6. WordPress will then import each of the posts, comments, and categories 6. WordPress will then import each of the posts, comments, and categories
contained in this file onto your blog. contained in this file onto your blog.
--> -->
@ -174,11 +174,11 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
while ( $next_posts = array_splice($post_ids, 0, 20) ) { while ( $next_posts = array_splice($post_ids, 0, 20) ) {
$where = "WHERE ID IN (".join(',', $next_posts).")"; $where = "WHERE ID IN (".join(',', $next_posts).")";
$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
foreach ($posts as $post) { foreach ($posts as $post) {
start_wp(); ?> start_wp(); ?>
<item> <item>
<title><?php the_title_rss() ?></title> <title><?php the_title_rss() ?></title>
<link><?php permalink_single_rss() ?></link> <link><?php the_permalink_rss() ?></link>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php the_author() ?></dc:creator> <dc:creator><?php the_author() ?></dc:creator>
<?php the_category_rss() ?> <?php the_category_rss() ?>

View File

@ -1,5 +1,5 @@
<?php <?php
/* /*
* wp-app.php - Atom Publishing Protocol support for WordPress * wp-app.php - Atom Publishing Protocol support for WordPress
* Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/ * Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/
* Modified by: Dougal Campbell, http://dougal.gunters.org/ * Modified by: Dougal Campbell, http://dougal.gunters.org/
@ -166,7 +166,7 @@ class AtomParser {
array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
} else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
$this->in_content = array(); $this->in_content = array();
$this->is_xhtml = $attrs['type'] == 'xhtml'; $this->is_xhtml = $attrs['type'] == 'xhtml';
array_push($this->in_content, array($tag,$this->depth)); array_push($this->in_content, array($tag,$this->depth));
} else if($tag == 'link') { } else if($tag == 'link') {
array_push($this->entry->links, $attrs); array_push($this->entry->links, $attrs);
@ -182,7 +182,7 @@ class AtomParser {
$tag = array_pop(split(":", $name)); $tag = array_pop(split(":", $name));
if(!empty($this->in_content)) { if(!empty($this->in_content)) {
if($this->in_content[0][0] == $tag && if($this->in_content[0][0] == $tag &&
$this->in_content[0][1] == $this->depth) { $this->in_content[0][1] == $this->depth) {
array_shift($this->in_content); array_shift($this->in_content);
if($this->is_xhtml) { if($this->is_xhtml) {
@ -245,14 +245,14 @@ class AtomParser {
} }
} }
} }
} }
return $name; return $name;
} }
function xml_escape($string) function xml_escape($string)
{ {
return str_replace(array('&','"',"'",'<','>'), return str_replace(array('&','"',"'",'<','>'),
array('&amp;','&quot;','&apos;','&lt;','&gt;'), array('&amp;','&quot;','&apos;','&lt;','&gt;'),
$string ); $string );
} }
} }
@ -284,27 +284,27 @@ class AtomServer {
$this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME']));
$this->selectors = array( $this->selectors = array(
'@/service@' => '@/service@' =>
array('GET' => 'get_service'), array('GET' => 'get_service'),
'@/categories@' => '@/categories@' =>
array('GET' => 'get_categories_xml'), array('GET' => 'get_categories_xml'),
'@/post/(\d+)@' => '@/post/(\d+)@' =>
array('GET' => 'get_post', array('GET' => 'get_post',
'PUT' => 'put_post', 'PUT' => 'put_post',
'DELETE' => 'delete_post'), 'DELETE' => 'delete_post'),
'@/posts/?([^/]+)?@' => '@/posts/?([^/]+)?@' =>
array('GET' => 'get_posts', array('GET' => 'get_posts',
'POST' => 'create_post'), 'POST' => 'create_post'),
'@/attachments/?(\d+)?@' => '@/attachments/?(\d+)?@' =>
array('GET' => 'get_attachment', array('GET' => 'get_attachment',
'POST' => 'create_attachment'), 'POST' => 'create_attachment'),
'@/attachment/file/(\d+)@' => '@/attachment/file/(\d+)@' =>
array('GET' => 'get_file', array('GET' => 'get_file',
'PUT' => 'put_file', 'PUT' => 'put_file',
'DELETE' => 'delete_file'), 'DELETE' => 'delete_file'),
'@/attachment/(\d+)@' => '@/attachment/(\d+)@' =>
array('GET' => 'get_attachment', array('GET' => 'get_attachment',
'PUT' => 'put_attachment', 'PUT' => 'put_attachment',
'DELETE' => 'delete_attachment'), 'DELETE' => 'delete_attachment'),
); );
} }
@ -324,7 +324,7 @@ class AtomServer {
$method = 'GET'; $method = 'GET';
} }
// lame. // lame.
if(strlen($path) == 0 || $path == '/') { if(strlen($path) == 0 || $path == '/') {
$path = '/service'; $path = '/service';
} }
@ -354,27 +354,27 @@ class AtomServer {
function get_service() { function get_service() {
log_app('function','get_service()'); log_app('function','get_service()');
$entries_url = $this->get_entries_url(); $entries_url = $this->get_entries_url();
$categories_url = $this->get_categories_url(); $categories_url = $this->get_categories_url();
$media_url = $this->get_attachments_url(); $media_url = $this->get_attachments_url();
$accepted_content_types = join(',',$this->media_content_types); $accepted_content_types = join(',',$this->media_content_types);
$introspection = <<<EOD $introspection = <<<EOD
<service xmlns="http://purl.org/atom/app#" xmlns:atom="http://www.w3.org/2005/Atom"> <service xmlns="http://purl.org/atom/app#" xmlns:atom="http://www.w3.org/2005/Atom">
<workspace title="WordPress Workspace"> <workspace title="WordPress Workspace">
<collection href="$entries_url" title="Posts"> <collection href="$entries_url" title="Posts">
<atom:title>WordPress Posts</atom:title> <atom:title>WordPress Posts</atom:title>
<accept>entry</accept> <accept>entry</accept>
<categories href="$categories_url" /> <categories href="$categories_url" />
</collection> </collection>
<collection href="$media_url" title="Media"> <collection href="$media_url" title="Media">
<atom:title>WordPress Media</atom:title> <atom:title>WordPress Media</atom:title>
<accept>$accepted_content_types</accept> <accept>$accepted_content_types</accept>
</collection> </collection>
</workspace> </workspace>
</service> </service>
EOD; EOD;
$this->output($introspection, $this->INTROSPECTION_CONTENT_TYPE); $this->output($introspection, $this->INTROSPECTION_CONTENT_TYPE);
} }
function get_categories_xml() { function get_categories_xml() {
@ -393,7 +393,7 @@ function get_categories_xml() {
$categories $categories
</app:categories> </app:categories>
EOD; EOD;
$this->output($output, $this->CATEGORIES_CONTENT_TYPE); $this->output($output, $this->CATEGORIES_CONTENT_TYPE);
} }
/* /*
@ -894,7 +894,7 @@ EOD;
$total_count = $this->get_posts_count(); $total_count = $this->get_posts_count();
$last_page = (int) ceil($total_count / $count); $last_page = (int) ceil($total_count / $count);
$next_page = (($page + 1) > $last_page) ? NULL : $page + 1; $next_page = (($page + 1) > $last_page) ? NULL : $page + 1;
$prev_page = ($page - 1) < 1 ? NULL : $page - 1; $prev_page = ($page - 1) < 1 ? NULL : $page - 1;
$last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page; $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page;
?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://purl.org/atom/app#" xml:lang="<?php echo get_option('rss_language'); ?>"> ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://purl.org/atom/app#" xml:lang="<?php echo get_option('rss_language'); ?>">
<id><?php $this->the_entries_url() ?></id> <id><?php $this->the_entries_url() ?></id>
@ -912,7 +912,7 @@ EOD;
<link rel="self" type="application/atom+xml" href="<?php $this->the_entries_url() ?>" /> <link rel="self" type="application/atom+xml" href="<?php $this->the_entries_url() ?>" />
<rights type="text">Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></rights> <rights type="text">Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></rights>
<generator uri="http://wordpress.com/" version="1.0.5-dc">WordPress.com Atom API</generator> <generator uri="http://wordpress.com/" version="1.0.5-dc">WordPress.com Atom API</generator>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); <?php if ( have_posts() ) : while ( have_posts() ) : the_post();
$post = $GLOBALS['post']; $post = $GLOBALS['post'];
?> ?>
<entry> <entry>
@ -934,7 +934,7 @@ $post = $GLOBALS['post'];
<link rel="edit" href="<?php $this->the_entry_url() ?>" /> <link rel="edit" href="<?php $this->the_entry_url() ?>" />
<link rel="edit-media" href="<?php $this->the_media_url() ?>" /> <link rel="edit-media" href="<?php $this->the_media_url() ?>" />
<?php } else { ?> <?php } else { ?>
<link href="<?php permalink_single_rss() ?>" /> <link href="<?php the_permalink_rss() ?>" />
<link rel="edit" href="<?php $this->the_entry_url() ?>" /> <link rel="edit" href="<?php $this->the_entry_url() ?>" />
<?php } ?> <?php } ?>
<?php foreach(get_the_category() as $category) { ?> <?php foreach(get_the_category() as $category) { ?>
@ -945,10 +945,10 @@ $post = $GLOBALS['post'];
<?php endif; ?> <?php endif; ?>
</entry> </entry>
<?php <?php
endwhile; endwhile;
endif; endif;
?></feed> ?></feed>
<?php <?php
$feed = ob_get_contents(); $feed = ob_get_contents();
ob_end_clean(); ob_end_clean();
return $feed; return $feed;
@ -990,7 +990,7 @@ $post = $GLOBALS['post'];
<link rel="edit-media" href="<?php $this->the_media_url() ?>" /> <link rel="edit-media" href="<?php $this->the_media_url() ?>" />
<content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/> <content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/>
<?php } else { ?> <?php } else { ?>
<link href="<?php permalink_single_rss() ?>" /> <link href="<?php the_permalink_rss() ?>" />
<link rel="edit" href="<?php $this->the_entry_url() ?>" /> <link rel="edit" href="<?php $this->the_entry_url() ?>" />
<?php } ?> <?php } ?>
<?php foreach(get_the_category() as $category) { ?> <?php foreach(get_the_category() as $category) { ?>
@ -1011,17 +1011,17 @@ $post = $GLOBALS['post'];
ob_end_clean(); ob_end_clean();
log_app('get_entry returning:',$entry); log_app('get_entry returning:',$entry);
return $entry; return $entry;
} }
function ok() { function ok() {
log_app('Status','200: OK'); log_app('Status','200: OK');
header('Content-Type: text/plain'); header('Content-Type: text/plain');
status_header('200'); status_header('200');
exit; exit;
} }
function no_content() { function no_content() {
log_app('Status','204: No Content'); log_app('Status','204: No Content');
header('Content-Type: text/plain'); header('Content-Type: text/plain');
status_header('204'); status_header('204');
@ -1109,7 +1109,7 @@ $post = $GLOBALS['post'];
log_app('Status','401: Auth Required'); log_app('Status','401: Auth Required');
nocache_headers(); nocache_headers();
header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"');
header('WWW-Authenticate: Form action="' . get_option('siteurl') . '/wp-login.php"', false); header('WWW-Authenticate: Form action="' . get_option('siteurl') . '/wp-login.php"', false);
header("HTTP/1.1 401 $msg"); header("HTTP/1.1 401 $msg");
header('Status: ' . $msg); header('Status: ' . $msg);
header('Content-Type: plain/text'); header('Content-Type: plain/text');
@ -1159,7 +1159,7 @@ $post = $GLOBALS['post'];
// if using mod_rewrite/ENV hack // if using mod_rewrite/ENV hack
// http://www.besthostratings.com/articles/http-auth-php-cgi.html // http://www.besthostratings.com/articles/http-auth-php-cgi.html
if(isset($_SERVER['HTTP_AUTHORIZATION'])) { if(isset($_SERVER['HTTP_AUTHORIZATION'])) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =
explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
} }
@ -1198,7 +1198,7 @@ $post = $GLOBALS['post'];
log_app("get_accepted_content_type", "type=$type, subtype=$subtype"); log_app("get_accepted_content_type", "type=$type, subtype=$subtype");
foreach($types as $t) { foreach($types as $t) {
list($acceptedType,$acceptedSubtype) = explode('/',$t); list($acceptedType,$acceptedSubtype) = explode('/',$t);
if($acceptedType == '*' || $acceptedType == $type) { if($acceptedType == '*' || $acceptedType == $type) {
if($acceptedSubtype == '*' || $acceptedSubtype == $subtype) if($acceptedSubtype == '*' || $acceptedSubtype == $subtype)
return $type; return $type;
@ -1233,9 +1233,9 @@ $post = $GLOBALS['post'];
@header("ETag: $wp_etag"); @header("ETag: $wp_etag");
// Support for Conditional GET // Support for Conditional GET
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
$client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
else else
$client_etag = false; $client_etag = false;
$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']); $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']);

View File

@ -236,7 +236,7 @@ function wp_get_linksbyname($category, $args = '') {
$cat = get_term_by('name', $cat_name, 'link_category'); $cat = get_term_by('name', $cat_name, 'link_category');
if ( !$cat ) if ( !$cat )
return false; return false;
$cat_id = $cat->term_id; $cat_id = $cat->term_id;
$args = add_query_arg('category', $cat_id, $args); $args = add_query_arg('category', $cat_id, $args);
wp_get_links($args); wp_get_links($args);
@ -266,7 +266,7 @@ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit
$cat_id = -1; $cat_id = -1;
$cat = get_term_by('name', $cat_name, 'link_category'); $cat = get_term_by('name', $cat_name, 'link_category');
if ( $cat ) if ( $cat )
$cat_id = $cat->term_id; $cat_id = $cat->term_id;
return get_linkobjects($cat_id, $orderby, $limit); return get_linkobjects($cat_id, $orderby, $limit);
} }
@ -314,7 +314,7 @@ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
$links_array = array(); $links_array = array();
foreach ($links as $link) { foreach ($links as $link) {
$links_array[] = $link; $links_array[] = $link;
} }
return $links_array; return $links_array;
@ -484,4 +484,9 @@ function permalink_link() {
the_permalink(); the_permalink();
} }
// Use the_permalink_rss()
function permalink_single_rss($file = '') {
the_permalink_rss();
}
?> ?>

View File

@ -31,14 +31,14 @@ $more = 1;
<?php endif; ?> <?php endif; ?>
</author> </author>
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title> <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
<link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" /> <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" />
<id><?php the_guid(); ?></id> <id><?php the_guid(); ?></id>
<updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated> <updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated>
<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published> <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
<?php the_category_rss('atom') ?> <?php the_category_rss('atom') ?>
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php if ( !get_option('rss_use_excerpt') ) : ?> <?php if ( !get_option('rss_use_excerpt') ) : ?>
<content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
<?php endif; ?> <?php endif; ?>
<?php atom_enclosure(); ?> <?php atom_enclosure(); ?>
<?php do_action('atom_entry'); ?> <?php do_action('atom_entry'); ?>

View File

@ -27,15 +27,15 @@ $more = 1;
<items> <items>
<rdf:Seq> <rdf:Seq>
<?php while (have_posts()): the_post(); ?> <?php while (have_posts()): the_post(); ?>
<rdf:li rdf:resource="<?php permalink_single_rss() ?>"/> <rdf:li rdf:resource="<?php the_permalink_rss() ?>"/>
<?php endwhile; ?> <?php endwhile; ?>
</rdf:Seq> </rdf:Seq>
</items> </items>
</channel> </channel>
<?php rewind_posts(); while (have_posts()): the_post(); ?> <?php rewind_posts(); while (have_posts()): the_post(); ?>
<item rdf:about="<?php permalink_single_rss() ?>"> <item rdf:about="<?php the_permalink_rss() ?>">
<title><?php the_title_rss() ?></title> <title><?php the_title_rss() ?></title>
<link><?php permalink_single_rss() ?></link> <link><?php the_permalink_rss() ?></link>
<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date> <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
<dc:creator><?php the_author() ?></dc:creator> <dc:creator><?php the_author() ?></dc:creator>
<?php the_category_rss('rdf') ?> <?php the_category_rss('rdf') ?>

View File

@ -23,7 +23,7 @@ $more = 1;
<?php } else { // use content ?> <?php } else { // use content ?>
<description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description> <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description>
<?php } ?> <?php } ?>
<link><?php permalink_single_rss() ?></link> <link><?php the_permalink_rss() ?></link>
<?php do_action('rss_item'); ?> <?php do_action('rss_item'); ?>
</item> </item>
<?php endwhile; ?> <?php endwhile; ?>

View File

@ -17,12 +17,12 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
else else
printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
?></title> ?></title>
<link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link> <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description> <description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo gmdate('r'); ?></pubDate> <pubDate><?php echo gmdate('r'); ?></pubDate>
<generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator>
<?php <?php
if ( have_comments() ) : while ( have_comments() ) : the_comment(); if ( have_comments() ) : while ( have_comments() ) : the_comment();
$comment_post = get_post($comment->comment_post_ID); $comment_post = get_post($comment->comment_post_ID);
get_post_custom($comment_post->ID); get_post_custom($comment_post->ID);

View File

@ -24,7 +24,7 @@ $more = 1;
<?php while( have_posts()) : the_post(); ?> <?php while( have_posts()) : the_post(); ?>
<item> <item>
<title><?php the_title_rss() ?></title> <title><?php the_title_rss() ?></title>
<link><?php permalink_single_rss() ?></link> <link><?php the_permalink_rss() ?></link>
<comments><?php comments_link(); ?></comments> <comments><?php comments_link(); ?></comments>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php the_author() ?></dc:creator> <dc:creator><?php the_author() ?></dc:creator>

View File

@ -69,12 +69,11 @@ function the_excerpt_rss() {
echo apply_filters('the_excerpt_rss', $output); echo apply_filters('the_excerpt_rss', $output);
} }
function the_permalink_rss() {
echo apply_filters('the_permalink_rss', get_permalink());
function permalink_single_rss($file = '') {
echo get_permalink();
} }
function comment_link() { function comment_link() {
echo get_comment_link(); echo get_comment_link();
} }