feed_content_type

The timeline below displays how wordpress function feed_content_type has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Returns the content type for specified feed type.
 *
 * @since 2.8.0
 *
 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 * @return string Content type for specified feed type.
 */
function feed_content_type($type = '')
{
    if (empty($type)) {
        $type = get_default_feed();
    }
    $types = array('rss' => 'application/rss+xml', 'rss2' => 'application/rss+xml', 'rss-http' => 'text/xml', 'atom' => 'application/atom+xml', 'rdf' => 'application/rdf+xml');
    $content_type = (!empty($types[$type])) ? $types[$type] : 'application/octet-stream';
    /**
     * Filters the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 6.1

/**
 * Returns the content type for specified feed type.
 *
 * @since 2.8.0
 *
 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 */
function feed_content_type($type = '')
{
    if (empty($type)) {
        $type = get_default_feed();
    }
    $types = array('rss' => 'application/rss+xml', 'rss2' => 'application/rss+xml', 'rss-http' => 'text/xml', 'atom' => 'application/atom+xml', 'rdf' => 'application/rdf+xml');
    $content_type = (!empty($types[$type])) ? $types[$type] : 'application/octet-stream';
    /**
     * Filters the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 4.6

/**
 * Return the content type for specified feed type.
 *
 * @since 2.8.0
 *
 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 */
function feed_content_type($type = '')
{
    if (empty($type)) {
        $type = get_default_feed();
    }
    $types = array('rss' => 'application/rss+xml', 'rss2' => 'application/rss+xml', 'rss-http' => 'text/xml', 'atom' => 'application/atom+xml', 'rdf' => 'application/rdf+xml');
    $content_type = (!empty($types[$type])) ? $types[$type] : 'application/octet-stream';
    /**
     * Filters the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 5.1

/**
 * Return the content type for specified feed type.
 *
 * @since 2.8.0
 *
 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 */
function feed_content_type($type = '')
{
    if (empty($type)) {
        $type = get_default_feed();
    }
    $types = array('rss' => 'application/rss+xml', 'rss2' => 'application/rss+xml', 'rss-http' => 'text/xml', 'atom' => 'application/atom+xml', 'rdf' => 'application/rdf+xml');
    $content_type = (!empty($types[$type])) ? $types[$type] : 'application/octet-stream';
    /**
     * Filter the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 4.5

/**
 * Return the content type for specified feed type.
 *
 * @since 2.8.0
 *
 * @param string $type Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
 */
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';
    /**
     * Filter the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 3.9

/**
 * Return the content type for specified feed type.
 *
 * @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', 'rss-http' => 'text/xml', 'atom' => 'application/atom+xml', 'rdf' => 'application/rdf+xml');
    $content_type = (!empty($types[$type])) ? $types[$type] : 'application/octet-stream';
    /**
     * Filter the content type for a specific feed type.
     *
     * @since 2.8.0
     *
     * @param string $content_type Content type indicating the type of data that a feed contains.
     * @param string $type         Type of feed. Possible values include 'rss2', 'atom'.
     *                             Default 'rss2'.
     */
    return apply_filters('feed_content_type', $content_type, $type);
}

WordPress Version: 3.7

/**
 * 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', 'rss-http' => 'text/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);
}