# the_terms()

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

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

## Сигнатура

```php
the_terms( int $post_id, string $taxonomy, string $before = '', string $sep = ', ', string $after = '' ): void|false
```

## Описание

Выводит термины записи в виде списка.

## Параметры

- `$post_id` `int` — обязательный. Идентификатор записи.
- `$taxonomy` `string` — обязательный. Имя таксономии.
- `$before` `string` — необязательный, по умолчанию `''`. Строка, вставляемая перед терминами.
- `$sep` `string` — необязательный, по умолчанию `', '`. Строка, вставляемая между терминами. Значение по умолчанию «, ».
- `$after` `string` — необязательный, по умолчанию `''`. Строка, вставляемая после терминов.

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

`void|false`

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

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

```php
function the_terms( $post_id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
	$term_list = get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );

	if ( is_wp_error( $term_list ) ) {
		return false;
	}

	/**
	 * Filters the list of terms to display.
	 *
	 * @since 2.9.0
	 *
	 * @param string $term_list List of terms to display.
	 * @param string $taxonomy  The taxonomy name.
	 * @param string $before    String to use before the terms.
	 * @param string $sep       String to use between the terms.
	 * @param string $after     String to use after the terms.
	 */
	echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
}
```

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

- 2.5.0 — Introduced.

## Связанные

Использует: [`get_the_term_list`](https://chugunov.pro/api-wordpress/functions/get_the_term_list/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).

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