# feed_content_type()

URL: https://chugunov.pro/api-wordpress/functions/feed_content_type/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.8.0.

## Сигнатура

```php
feed_content_type( string $type = '' ): string
```

## Описание

Возвращает тип содержимого для указанного типа фида.

## Параметры

- `$type` `string` — необязательный, по умолчанию `''`. Тип фида. Возможные значения: 'rss', 'rss2', 'atom' и 'rdf'.

## Возвращаемое значение

`string`

## Исходный код

Файл: `wp-includes/feed.php:768`

```php
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 );
}
```

## История изменений

- 2.8.0 — Introduced.

## Связанные

Использует: [`get_default_feed`](https://chugunov.pro/api-wordpress/functions/get_default_feed/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`feed_links`](https://chugunov.pro/api-wordpress/functions/feed_links/), [`feed_links_extra`](https://chugunov.pro/api-wordpress/functions/feed_links_extra/), `WP::send_headers`.

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/feed_content_type/
