wp/wp-includes/feed-atom.php
author ymh <ymh.work@gmail.com>
Wed, 06 Nov 2013 03:21:17 +0000
changeset 0 d970ebf37754
child 5 5e2f62d02dcd
permissions -rw-r--r--
first import
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
 * Atom Feed Template for displaying Atom 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('atom') . '; 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
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
<feed
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
  xmlns="http://www.w3.org/2005/Atom"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
  xmlns:thr="http://purl.org/syndication/thread/1.0"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
  xml:lang="<?php bloginfo_rss( 'language' ); ?>"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
  xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
  <?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
   * Fires at end of the Atom feed root to add namespaces.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
   *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
   * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
  do_action( 'atom_ns' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
  ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
 >
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
	<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
	<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
	<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url') ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
	<id><?php bloginfo('atom_url'); ?></id>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
	<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	 * Fires just before the first Atom feed entry.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
	do_action( 'atom_head' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	while ( have_posts() ) : the_post();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
	<entry>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
		<author>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
			<name><?php the_author() ?></name>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
			<?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
			<uri><?php the_author_meta('url')?></uri>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
			<?php endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
			/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
			 * Fires at the end of each Atom feed author entry.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
			 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
			 * @since 3.2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
			 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
			do_action( 'atom_author' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
		</author>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
		<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
		<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
		<id><?php the_guid() ; ?></id>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
		<updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
		<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
		<?php the_category_rss('atom') ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
		<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
<?php if ( !get_option('rss_use_excerpt') ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
		<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
	<?php atom_enclosure();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
	 * Fires at the end of each Atom feed item.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
	do_action( 'atom_entry' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
		<link rel="replies" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
		<link rel="replies" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link(0, 'atom') ); ?>" thr:count="<?php echo get_comments_number()?>"/>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
		<thr:total><?php echo get_comments_number()?></thr:total>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
	</entry>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
	<?php endwhile ; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
</feed>