# rest_url()

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

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

## Сигнатура

```php
rest_url( string $path = '', string $scheme = 'rest' ): string
```

## Описание

Примечание: возвращаемый URL НЕ экранирован.

## Параметры

- `$path` `string` — необязательный, по умолчанию `''`. Маршрут REST.
- `$scheme` `string` — необязательный, по умолчанию `'rest'`. Схема очистки. Значение по умолчанию — 'rest'.

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

`string`

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

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

```php
function rest_url( $path = '', $scheme = 'rest' ) {
	return get_rest_url( null, $path, $scheme );
}
```

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

- 4.4.0 — Introduced.

## Связанные

Использует: [`get_rest_url`](https://chugunov.pro/api-wordpress/functions/get_rest_url/).
Используется в: `WP_REST_Attachments_Controller::prepare_links`, `WP_REST_Abilities_V1_Categories_Controller::get_items`, `WP_REST_Abilities_V1_Categories_Controller::prepare_item_for_response`, `WP_REST_Abilities_V1_List_Controller::get_items`, `WP_REST_Abilities_V1_List_Controller::prepare_item_for_response`, `WP_REST_Font_Faces_Controller::prepare_links`, `WP_REST_Font_Families_Controller::prepare_font_face_links`, `WP_REST_Font_Collections_Controller::prepare_links`, `WP_REST_Font_Collections_Controller::get_items`, `WP_REST_Template_Autosaves_Controller::prepare_links`, `WP_REST_Template_Revisions_Controller::prepare_links`, `WP_REST_Navigation_Fallback_Controller::prepare_links`, `WP_REST_Global_Styles_Revisions_Controller::get_items`, `WP_REST_Post_Types_Controller::prepare_links`, `WP_REST_Taxonomies_Controller::prepare_links`, `WP_REST_Server::add_image_to_index`, `WP_REST_Menu_Items_Controller::prepare_links`, `WP_REST_Menu_Items_Controller::get_schema_links`, `WP_REST_Global_Styles_Controller::get_theme_item`, `WP_REST_Menu_Items_Controller::create_item`, `WP_REST_Global_Styles_Controller::prepare_links`, `WP_REST_Menus_Controller::prepare_links`, `WP_REST_Menus_Controller::create_item`, `WP_REST_Menu_Locations_Controller::prepare_links`, `WP_REST_Widgets_Controller::prepare_links`, `WP_REST_Sidebars_Controller::prepare_links`, `WP_REST_Templates_Controller::prepare_links`, `WP_REST_Templates_Controller::create_item`, `WP_REST_Widget_Types_Controller::prepare_links`, `WP_REST_Server::add_active_theme_link_to_index`, `WP_REST_Themes_Controller::prepare_links`, `WP_REST_Application_Passwords_Controller::prepare_links`, `WP_REST_Term_Search_Handler::prepare_item_links`, `WP_REST_Block_Directory_Controller::prepare_links`, `WP_REST_Plugins_Controller::prepare_links`, `WP_REST_Plugins_Controller::create_item`, `WP_REST_Block_Types_Controller::prepare_links`, `WP_REST_Attachments_Controller::edit_media_item`, `WP_Site_Health::get_test_rest_availability`, `WP_Site_Health::get_tests`.

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