функция
since 2.8.0
esc_url_raw()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
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
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. |

