wp/wp-includes/feed-rss2.php
author ymh <ymh.work@gmail.com>
Tue, 09 Jun 2015 03:35:32 +0200
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
permissions -rw-r--r--
upgrade wordpress + plugins
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * RSS2 Feed Template for displaying RSS2 Posts feed.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
$more = 1;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    11
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    13
/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    14
 * Fires between the xml and rss tags in a feed.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    15
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    16
 * @since 4.0.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    18
 * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    19
 *                        'rdf', 'atom', and 'atom-comments'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    20
 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    21
do_action( 'rss_tag_pre', 'rss2' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    22
?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
<rss version="2.0"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
	xmlns:dc="http://purl.org/dc/elements/1.1/"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
	xmlns:atom="http://www.w3.org/2005/Atom"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
	 * Fires at the end of the RSS root to add namespaces.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
	do_action( 'rss2_ns' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
<channel>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
	<title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	<link><?php bloginfo_rss('url') ?></link>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	<description><?php bloginfo_rss("description") ?></description>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
	<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
	<language><?php bloginfo_rss( 'language' ); ?></language>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    47
	<sy:updatePeriod><?php
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
		$duration = 'hourly';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    49
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    50
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    51
		 * Filter how often to update the RSS feed.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    52
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    53
		 * @since 2.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    54
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    55
		 * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
		 *                         'yearly'. Default 'hourly'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    57
		 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    58
		echo apply_filters( 'rss_update_period', $duration );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    59
	?></sy:updatePeriod>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    60
	<sy:updateFrequency><?php
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    61
		$frequency = '1';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    62
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    63
		/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    64
		 * Filter the RSS update frequency.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    65
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    66
		 * @since 2.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    67
		 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    68
		 * @param string $frequency An integer passed as a string representing the frequency
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    69
		 *                          of RSS updates within the update period. Default '1'.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    70
		 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    71
		echo apply_filters( 'rss_update_frequency', $frequency );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    72
	?></sy:updateFrequency>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
	 * Fires at the end of the RSS2 Feed Header.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
	do_action( 'rss2_head');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
	while( have_posts()) : the_post();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
	<item>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
		<title><?php the_title_rss() ?></title>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
		<link><?php the_permalink_rss() ?></link>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
		<comments><?php comments_link_feed(); ?></comments>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
		<dc:creator><![CDATA[<?php the_author() ?>]]></dc:creator>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
		<?php the_category_rss('rss2') ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
		<guid isPermaLink="false"><?php the_guid(); ?></guid>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
<?php if (get_option('rss_use_excerpt')) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
<?php else : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
		<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
	<?php $content = get_the_content_feed('rss2'); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
	<?php if ( strlen( $content ) > 0 ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
		<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
	<?php else : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
		<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
	<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
		<slash:comments><?php echo get_comments_number(); ?></slash:comments>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
<?php rss_enclosure(); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
	 * Fires at the end of each RSS2 feed item.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
	do_action( 'rss2_item' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
	</item>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
	<?php endwhile; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
</channel>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
</rss>