# _post_format_get_terms()

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

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

## Сигнатура

```php
_post_format_get_terms( array $terms, string|array $taxonomies, array $args ): array
```

## Описание

Удаляет префикс формата записи из свойства name объектов терминов, созданных функцией get_terms() .

## Параметры

- `$terms` `array` — обязательный
- `$taxonomies` `string|array` — обязательный
- `$args` `array` — обязательный

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

`array`

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

Файл: `wp-includes/post-formats.php:234`

```php
function _post_format_get_terms( $terms, $taxonomies, $args ) {
	if ( in_array( 'post_format', (array) $taxonomies, true ) ) {
		if ( isset( $args['fields'] ) && 'names' === $args['fields'] ) {
			foreach ( $terms as $order => $name ) {
				$terms[ $order ] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
			}
		} else {
			foreach ( (array) $terms as $order => $term ) {
				if ( isset( $term->taxonomy ) && 'post_format' === $term->taxonomy ) {
					$terms[ $order ]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
				}
			}
		}
	}
	return $terms;
}
```

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

- 3.1.0 — Introduced.

## Связанные

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

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