PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-includes/feed-atom.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 55 lines | 45 code | 5 blank | 5 comment | 3 complexity | abb0bfbadc1a70626775950cfb1d7f1b MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. /**
  3. * Atom Feed Template for displaying Atom Posts feed.
  4. *
  5. * @package WordPress
  6. */
  7. header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
  8. $more = 1;
  9. echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
  10. <feed
  11. xmlns="http://www.w3.org/2005/Atom"
  12. xmlns:thr="http://purl.org/syndication/thread/1.0"
  13. xml:lang="<?php bloginfo_rss( 'language' ); ?>"
  14. xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
  15. <?php do_action('atom_ns'); ?>
  16. >
  17. <title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
  18. <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
  19. <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
  20. <link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
  21. <id><?php bloginfo('atom_url'); ?></id>
  22. <link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
  23. <?php do_action('atom_head'); ?>
  24. <?php while (have_posts()) : the_post(); ?>
  25. <entry>
  26. <author>
  27. <name><?php the_author() ?></name>
  28. <?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
  29. <uri><?php the_author_meta('url')?></uri>
  30. <?php endif;
  31. do_action('atom_author'); ?>
  32. </author>
  33. <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
  34. <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" />
  35. <id><?php the_guid() ; ?></id>
  36. <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
  37. <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
  38. <?php the_category_rss('atom') ?>
  39. <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
  40. <?php if ( !get_option('rss_use_excerpt') ) : ?>
  41. <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
  42. <?php endif; ?>
  43. <?php atom_enclosure(); ?>
  44. <?php do_action('atom_entry'); ?>
  45. <link rel="replies" type="text/html" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
  46. <link rel="replies" type="application/atom+xml" href="<?php echo get_post_comments_feed_link(0,'atom') ?>" thr:count="<?php echo get_comments_number()?>"/>
  47. <thr:total><?php echo get_comments_number()?></thr:total>
  48. </entry>
  49. <?php endwhile ; ?>
  50. </feed>