wp/wp-includes/feed-atom.php
author ymh <ymh.work@gmail.com>
Mon, 14 Oct 2019 17:39:30 +0200
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
permissions -rw-r--r--
resynchronize code repo with production
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
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').'"?'.'>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    12
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    13
/** This action is documented in wp-includes/feed-rss2.php */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    14
do_action( 'rss_tag_pre', 'atom' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    15
?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
<feed
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
  xmlns="http://www.w3.org/2005/Atom"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
  xmlns:thr="http://purl.org/syndication/thread/1.0"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
  xml:lang="<?php bloginfo_rss( 'language' ); ?>"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
  xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
  <?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
  /**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
   * Fires at end of the Atom feed root to add namespaces.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
   *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
   * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
   */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
  do_action( 'atom_ns' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
  ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
 >
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    30
	<title type="text"><?php wp_title_rss(); ?></title>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
	<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    33
	<updated><?php
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    34
		$date = get_lastpostmodified( 'GMT' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    35
		echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    36
	?></updated>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
	<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
    39
	<id><?php bloginfo('atom_url'); ?></id>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
	<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	 * Fires just before the first Atom feed entry.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
	do_action( 'atom_head' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
	while ( have_posts() ) : the_post();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
	<entry>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
		<author>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
			<name><?php the_author() ?></name>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
			<?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
			<uri><?php the_author_meta('url')?></uri>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
			<?php endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
			/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
			 * Fires at the end of each Atom feed author entry.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
			 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
			 * @since 3.2.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
			 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
			do_action( 'atom_author' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
		</author>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
		<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
		<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
    69
		<id><?php the_guid() ; ?></id>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
		<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
    71
		<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
    72
		<?php the_category_rss('atom') ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
		<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
<?php if ( !get_option('rss_use_excerpt') ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
		<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
    76
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
	<?php atom_enclosure();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
	 * Fires at the end of each Atom feed item.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
	 * @since 2.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
	do_action( 'atom_entry' );
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    84
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    85
	if ( get_comments_number() || comments_open() ) :
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
		?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
		<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
    88
		<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
    89
		<thr:total><?php echo get_comments_number()?></thr:total>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    90
	<?php endif; ?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
	</entry>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
	<?php endwhile ; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
</feed>