author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 19 | 3d72ae0968f4 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Atom Feed Template for displaying Atom Posts feed. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
*/ |
|
7 |
||
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
8 |
// Don't load directly. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
9 |
if ( ! defined( 'ABSPATH' ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
10 |
die( '-1' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
11 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
12 |
|
9 | 13 |
header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true ); |
0 | 14 |
$more = 1; |
15 |
||
9 | 16 |
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; |
5 | 17 |
|
18 |
/** This action is documented in wp-includes/feed-rss2.php */ |
|
19 |
do_action( 'rss_tag_pre', 'atom' ); |
|
20 |
?> |
|
0 | 21 |
<feed |
9 | 22 |
xmlns="http://www.w3.org/2005/Atom" |
23 |
xmlns:thr="http://purl.org/syndication/thread/1.0" |
|
24 |
xml:lang="<?php bloginfo_rss( 'language' ); ?>" |
|
25 |
<?php |
|
26 |
/** |
|
27 |
* Fires at end of the Atom feed root to add namespaces. |
|
28 |
* |
|
29 |
* @since 2.0.0 |
|
30 |
*/ |
|
31 |
do_action( 'atom_ns' ); |
|
32 |
?> |
|
33 |
> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
<title type="text"><?php wp_title_rss(); ?></title> |
9 | 35 |
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle> |
0 | 36 |
|
9 | 37 |
<updated><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?></updated> |
0 | 38 |
|
9 | 39 |
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" /> |
40 |
<id><?php bloginfo( 'atom_url' ); ?></id> |
|
0 | 41 |
<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" /> |
42 |
||
43 |
<?php |
|
44 |
/** |
|
45 |
* Fires just before the first Atom feed entry. |
|
46 |
* |
|
47 |
* @since 2.0.0 |
|
48 |
*/ |
|
49 |
do_action( 'atom_head' ); |
|
50 |
||
9 | 51 |
while ( have_posts() ) : |
52 |
the_post(); |
|
53 |
?> |
|
0 | 54 |
<entry> |
55 |
<author> |
|
9 | 56 |
<name><?php the_author(); ?></name> |
16 | 57 |
<?php |
58 |
$author_url = get_the_author_meta( 'url' ); |
|
59 |
if ( ! empty( $author_url ) ) : |
|
60 |
?> |
|
61 |
<uri><?php the_author_meta( 'url' ); ?></uri> |
|
9 | 62 |
<?php |
63 |
endif; |
|
0 | 64 |
|
65 |
/** |
|
66 |
* Fires at the end of each Atom feed author entry. |
|
67 |
* |
|
68 |
* @since 3.2.0 |
|
69 |
*/ |
|
70 |
do_action( 'atom_author' ); |
|
9 | 71 |
?> |
0 | 72 |
</author> |
16 | 73 |
|
9 | 74 |
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss(); ?>]]></title> |
75 |
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>" /> |
|
16 | 76 |
|
9 | 77 |
<id><?php the_guid(); ?></id> |
78 |
<updated><?php echo get_post_modified_time( 'Y-m-d\TH:i:s\Z', true ); ?></updated> |
|
79 |
<published><?php echo get_post_time( 'Y-m-d\TH:i:s\Z', true ); ?></published> |
|
80 |
<?php the_category_rss( 'atom' ); ?> |
|
16 | 81 |
|
0 | 82 |
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> |
16 | 83 |
|
9 | 84 |
<?php if ( ! get_option( 'rss_use_excerpt' ) ) : ?> |
16 | 85 |
<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss(); ?>"><![CDATA[<?php the_content_feed( 'atom' ); ?>]]></content> |
9 | 86 |
<?php endif; ?> |
16 | 87 |
|
9 | 88 |
<?php |
89 |
atom_enclosure(); |
|
16 | 90 |
|
9 | 91 |
/** |
92 |
* Fires at the end of each Atom feed item. |
|
93 |
* |
|
94 |
* @since 2.0.0 |
|
95 |
*/ |
|
96 |
do_action( 'atom_entry' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
97 |
|
9 | 98 |
if ( get_comments_number() || comments_open() ) : |
99 |
?> |
|
18 | 100 |
<link rel="replies" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>#comments" thr:count="<?php echo get_comments_number(); ?>" /> |
101 |
<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(); ?>" /> |
|
16 | 102 |
<thr:total><?php echo get_comments_number(); ?></thr:total> |
9 | 103 |
<?php endif; ?> |
0 | 104 |
</entry> |
9 | 105 |
<?php endwhile; ?> |
0 | 106 |
</feed> |