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

@ -178,7 +178,7 @@ print '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
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

@ -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) { ?>
@ -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) { ?>

View File

@ -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,7 +17,7 @@ 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>

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();
} }