# rest_do_request()

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

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

## Сигнатура

```php
rest_do_request( WP_REST_Request|string $request ): WP_REST_Response
```

## Описание

Используется в основном для маршрутизации внутренних запросов через WP_REST_Server.

## Параметры

- `$request` `WP_REST_Request|string` — обязательный. Запрос.

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

`WP_REST_Response`

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

Файл: `wp-includes/rest-api.php:596`

```php
function rest_do_request( $request ) {
	$request = rest_ensure_request( $request );
	return rest_get_server()->dispatch( $request );
}
```

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

- 4.4.0 — Introduced.

## Связанные

Использует: [`rest_get_server`](https://chugunov.pro/api-wordpress/functions/rest_get_server/), [`rest_ensure_request`](https://chugunov.pro/api-wordpress/functions/rest_ensure_request/).
Используется в: [`_register_remote_theme_patterns`](https://chugunov.pro/api-wordpress/functions/_register_remote_theme_patterns/), [`_load_remote_featured_patterns`](https://chugunov.pro/api-wordpress/functions/_load_remote_featured_patterns/), [`_load_remote_block_patterns`](https://chugunov.pro/api-wordpress/functions/_load_remote_block_patterns/), [`rest_preload_api_request`](https://chugunov.pro/api-wordpress/functions/rest_preload_api_request/).

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