Introduce 'rss_tag_pre' action, which fires between the xml and rss tags in a feed.

props solarissmoke, wonderboymusic, DrewAPicture.
fixes #19017.
Built from https://develop.svn.wordpress.org/trunk@29014


git-svn-id: http://core.svn.wordpress.org/trunk@28802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-07-07 10:18:15 +00:00
parent f5b5b89e66
commit c321e40016
5 changed files with 31 additions and 7 deletions

View File

@ -7,15 +7,18 @@
header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>';
/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'atom-comments' );
?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xml:lang="<?php bloginfo_rss( 'language' ); ?>"
xmlns:thr="http://purl.org/syndication/thread/1.0"
<?php
<?php
/** This action is documented in wp-includes/feed-atom.php */
do_action( 'atom_ns' );
do_action( 'atom_ns' );
/**
* Fires inside the feed tag in the Atom comment feed.
*
@ -49,7 +52,7 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
<id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?>
<?php
<?php
/**
* Fires at the end of the Atom comment feed header.
*

View File

@ -8,7 +8,11 @@
header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'atom' );
?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xmlns:thr="http://purl.org/syndication/thread/1.0"

View File

@ -8,7 +8,11 @@
header('Content-Type: ' . feed_content_type('rdf') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'rdf' );
?>
<rdf:RDF
xmlns="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

View File

@ -8,6 +8,9 @@
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'rss2-comments' );
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"

View File

@ -8,8 +8,18 @@
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
/**
* Fires between the <xml> and <rss> tags in a feed.
*
* @since 4.0.0
*
* @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
* 'rdf', 'atom', and 'atom-comments'.
*/
do_action( 'rss_tag_pre', 'rss2' );
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"