2007-02-23 03:50:05 +01:00
|
|
|
<?php
|
2007-12-25 21:48:01 +01:00
|
|
|
/**
|
|
|
|
* Atom Feed Template for displaying Atom Posts feed.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
*/
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
|
2007-02-23 03:50:05 +01:00
|
|
|
$more = 1;
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
|
2014-07-07 12:18:15 +02:00
|
|
|
|
|
|
|
/** This action is documented in wp-includes/feed-rss2.php */
|
|
|
|
do_action( 'rss_tag_pre', 'atom' );
|
|
|
|
?>
|
2007-02-23 03:50:05 +01:00
|
|
|
<feed
|
2017-11-27 00:57:55 +01:00
|
|
|
xmlns="http://www.w3.org/2005/Atom"
|
|
|
|
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
|
|
|
xml:lang="<?php bloginfo_rss( 'language' ); ?>"
|
2017-12-01 00:11:00 +01:00
|
|
|
xml:base="<?php bloginfo_rss( 'url' ); ?>/wp-atom.php"
|
2017-11-27 00:57:55 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Fires at end of the Atom feed root to add namespaces.
|
|
|
|
*
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
do_action( 'atom_ns' );
|
|
|
|
?>
|
|
|
|
>
|
2015-10-20 18:21:25 +02:00
|
|
|
<title type="text"><?php wp_title_rss(); ?></title>
|
2017-12-01 00:11:00 +01:00
|
|
|
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle>
|
2007-02-27 16:24:54 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
<updated>
|
|
|
|
<?php
|
Feeds: ensure build/update date matches current query.
Displaying the correct build date in feeds is as important today as it was twelve years ago when this ticket was opened.
Fix an issue where all feeds in WordPress showed the same date for their last build date (the datapoint is `lastBuildDate`, `updated` or `dc:date` depending on the feed type).
Introduce a new `get_last_build_date` filter to adjust the date used for `lastBuildDate`. Developers who previously filtered `get_lastcommentmodified` to alter feed dates should use this filter instead.
* `get_last_build_date` extracts the latest post (or comment) in the current WP_Query object.
* In all feed templates, use `get_last_build_date` vs `get_lastpostmodified( 'GMT' );`.
Props stevenkword, spacedmonkey, ryanshoover, mauteri, nacin, jorbin, MikeNGarrett, Denis-de-Bernardy, peaceablewhale.
Fixes #4575.
Built from https://develop.svn.wordpress.org/trunk@44948
git-svn-id: http://core.svn.wordpress.org/trunk@44779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-20 21:39:00 +01:00
|
|
|
$date = get_last_build_date();
|
2016-12-16 07:39:41 +01:00
|
|
|
echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date, false ) : date( 'Y-m-d\TH:i:s\Z' );
|
2017-12-01 00:11:00 +01:00
|
|
|
?>
|
|
|
|
</updated>
|
2007-02-23 03:50:05 +01:00
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" />
|
|
|
|
<id><?php bloginfo( 'atom_url' ); ?></id>
|
2008-03-11 19:18:22 +01:00
|
|
|
<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
|
2007-02-23 03:50:05 +01:00
|
|
|
|
2013-09-21 00:50:10 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Fires just before the first Atom feed entry.
|
|
|
|
*
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
do_action( 'atom_head' );
|
|
|
|
|
2017-12-01 00:11:00 +01:00
|
|
|
while ( have_posts() ) :
|
|
|
|
the_post();
|
2018-08-17 03:51:36 +02:00
|
|
|
?>
|
2007-02-23 03:50:05 +01:00
|
|
|
<entry>
|
|
|
|
<author>
|
2017-12-01 00:11:00 +01:00
|
|
|
<name><?php the_author(); ?></name>
|
|
|
|
<?php $author_url = get_the_author_meta( 'url' ); if ( ! empty( $author_url ) ) : ?>
|
|
|
|
<uri><?php the_author_meta( 'url' ); ?></uri>
|
2018-08-17 03:51:36 +02:00
|
|
|
<?php
|
2017-12-01 00:11:00 +01:00
|
|
|
endif;
|
2013-09-21 00:50:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fires at the end of each Atom feed author entry.
|
|
|
|
*
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
do_action( 'atom_author' );
|
2019-01-12 07:41:52 +01:00
|
|
|
?>
|
2007-02-23 03:50:05 +01:00
|
|
|
</author>
|
2017-12-01 00:11:00 +01:00
|
|
|
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss(); ?>]]></title>
|
|
|
|
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>" />
|
|
|
|
<id><?php the_guid(); ?></id>
|
|
|
|
<updated><?php echo get_post_modified_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>
|
|
|
|
<?php the_category_rss( 'atom' ); ?>
|
2007-11-06 19:23:16 +01:00
|
|
|
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
|
2018-08-17 03:51:36 +02:00
|
|
|
<?php if ( ! get_option( 'rss_use_excerpt' ) ) : ?>
|
2017-12-01 00:11:00 +01:00
|
|
|
<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss(); ?>"><![CDATA[<?php the_content_feed( 'atom' ); ?>]]></content>
|
2018-08-17 03:51:36 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
atom_enclosure();
|
|
|
|
/**
|
|
|
|
* Fires at the end of each Atom feed item.
|
|
|
|
*
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
do_action( 'atom_entry' );
|
2015-11-04 18:47:25 +01:00
|
|
|
|
2018-08-17 03:51:36 +02:00
|
|
|
if ( get_comments_number() || comments_open() ) :
|
|
|
|
?>
|
2017-12-01 00:11:00 +01:00
|
|
|
<link rel="replies" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>#comments" thr:count="<?php echo get_comments_number(); ?>"/>
|
|
|
|
<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(); ?>"/>
|
|
|
|
<thr:total><?php echo get_comments_number(); ?></thr:total>
|
2018-08-17 03:51:36 +02:00
|
|
|
<?php endif; ?>
|
2007-02-23 03:50:05 +01:00
|
|
|
</entry>
|
2017-12-01 00:11:00 +01:00
|
|
|
<?php endwhile; ?>
|
2007-09-12 18:26:39 +02:00
|
|
|
</feed>
|