# esc_url_raw()

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

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

## Сигнатура

```php
esc_url_raw( string $url, string[] $protocols = null ): string
```

## Описание

Эта функция является псевдонимом для sanitize_url() .
См. alsosanitize_url()

## Параметры

- `$url` `string` — обязательный. URL, который нужно очистить.
- `$protocols` `string[]` — необязательный, по умолчанию `null`. Массив допустимых протоколов.
  
  По умолчанию — возвращаемое значение wp_allowed_protocols() .

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

`string` — sanitize_url()

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

Файл: `wp-includes/formatting.php:4598`

```php
function esc_url_raw( $url, $protocols = null ) {
	return sanitize_url( $url, $protocols );
}
```

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

- 6.9.0 — Prepends https:// to the URL if it does not already contain a scheme and the first item in $protocols is 'https'.
- 6.1.0 — Turned into an alias for sanitize_url() .
- 2.8.0 — Introduced.

## Связанные

Использует: [`sanitize_url`](https://chugunov.pro/api-wordpress/functions/sanitize_url/).
Используется в: [`wp_hoist_late_printed_styles`](https://chugunov.pro/api-wordpress/functions/wp_hoist_late_printed_styles/), [`print_embed_scripts`](https://chugunov.pro/api-wordpress/functions/print_embed_scripts/), [`get_post_embed_html`](https://chugunov.pro/api-wordpress/functions/get_post_embed_html/), `WP_Styles::print_inline_style`, `WP_Scripts::do_item`.

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