Add support for automatic feed links in themes, props Viper007Bond, see #8878

git-svn-id: https://develop.svn.wordpress.org/trunk@10377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-01-19 05:04:58 +00:00
parent 2a684445e6
commit 19577d0a8d
14 changed files with 126 additions and 20 deletions
+23
View File
@@ -508,4 +508,27 @@ function self_link() {
);
}
/**
* Return the content type for specified feed type.
*
* @package WordPress
* @subpackage Feed
* @since 2.8.0
*/
function feed_content_type( $type = '' ) {
if ( empty($type) )
$type = get_default_feed();
$types = array(
'rss' => 'application/rss+xml',
'rss2' => 'application/rss+xml',
'atom' => 'application/atom+xml',
'rdf' => 'application/rdf+xml',
);
$content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream';
return apply_filters( 'feed_content_type', $content_type, $type );
}
?>