Make WordPress Core


Ignore:
Timestamp:
01/19/2009 05:04:58 AM (18 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed.php

    r10332 r10377  
    509509}
    510510
     511/**
     512 * Return the content type for specified feed type.
     513 *
     514 * @package WordPress
     515 * @subpackage Feed
     516 * @since 2.8.0
     517 */
     518function feed_content_type( $type = '' ) {
     519        if ( empty($type) )
     520                $type = get_default_feed();
     521
     522        $types = array(
     523                'rss'  => 'application/rss+xml',
     524                'rss2' => 'application/rss+xml',
     525                'atom' => 'application/atom+xml',
     526                'rdf'  => 'application/rdf+xml',
     527        );
     528
     529        $content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream';
     530
     531        return apply_filters( 'feed_content_type', $content_type, $type );
     532}
     533
    511534?>
Note: See TracChangeset for help on using the changeset viewer.