# translate_with_context()

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

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

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

## Сигнатура

```php
translate_with_context( string $text, string $domain = 'default' ): string
```

## Описание

См. also_x()

## Параметры

- `$text` `string` — обязательный. Текст для перевода.
- `$domain` `string` — необязательный, по умолчанию `'default'`. Домен, из которого нужно получить переведённый текст.

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

`string`

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

Файл: `wp-includes/deprecated.php:1793`

```php
function translate_with_context( $text, $domain = 'default' ) {
	_deprecated_function( __FUNCTION__, '2.9.0', '_x()' );
	return before_last_bar( translate( $text, $domain ) );
}
```

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

- 3.0.0 — Deprecated. Use _x()
- 2.5.0 — Introduced.

## Связанные

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

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