# term_description()

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

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

> Устаревший элемент. Помечен устаревшим с версии 4.9.2.

## Сигнатура

```php
term_description( int $term, mixed $deprecated = null ): string
```

## Описание

Получает описание термина.

## Параметры

- `$term` `int` — необязательный. ID термина. По умолчанию используется ID текущего термина.
- `$deprecated` `mixed` — необязательный, по умолчанию `null`. Не используется.

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

`string`

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

Файл: `wp-includes/category-template.php:1265`

```php
function term_description( $term = 0, $deprecated = null ) {
	if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) {
		$term = get_queried_object();
		if ( $term ) {
			$term = $term->term_id;
		}
	}

	$description = get_term_field( 'description', $term );

	return is_wp_error( $description ) ? '' : $description;
}
```

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

- 4.9.2 — The $taxonomy parameter was deprecated.
- 2.8.0 — Introduced.

## Связанные

Использует: [`is_tax`](https://chugunov.pro/api-wordpress/functions/is_tax/), [`is_tag`](https://chugunov.pro/api-wordpress/functions/is_tag/), [`is_category`](https://chugunov.pro/api-wordpress/functions/is_category/), [`get_queried_object`](https://chugunov.pro/api-wordpress/functions/get_queried_object/), [`get_term_field`](https://chugunov.pro/api-wordpress/functions/get_term_field/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).
Используется в: [`get_the_archive_description`](https://chugunov.pro/api-wordpress/functions/get_the_archive_description/), [`tag_description`](https://chugunov.pro/api-wordpress/functions/tag_description/), [`category_description`](https://chugunov.pro/api-wordpress/functions/category_description/).

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