mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user