# wp_allowed_protocols()

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

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

## Сигнатура

```php
wp_allowed_protocols(): string[]
```

## Описание

Смотрите alsowp_kses()

esc_url()

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

`string[]` — 'http' 'https' 'ftp' 'ftps' 'mailto' 'news' 'irc' 'irc6' 'ircs' 'gopher' 'nntp' 'feed' 'telnet' 'mms' 'rtsp' 'sms' 'svn' 'tel' 'fax' 'xmpp' 'webcal' 'urn' 'javascript'

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

Файл: `wp-includes/functions.php:7241`

```php
function wp_allowed_protocols() {
	static $protocols = array();

	if ( empty( $protocols ) ) {
		$protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'irc6', 'ircs', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' );
	}

	if ( ! did_action( 'wp_loaded' ) ) {
		/**
		 * Filters the list of protocols allowed in HTML attributes.
		 *
		 * @since 3.0.0
		 *
		 * @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
		 */
		$protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) );
	}

	return $protocols;
}
```

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

- 5.6.0 — Added 'irc6' and 'ircs' to the protocols array.
- 5.3.0 — Added 'sms' to the protocols array.
- 4.7.0 — Added 'urn' to the protocols array.
- 4.3.0 — Added 'webcal' to the protocols array.
- 3.3.0 — Introduced.

## Связанные

Использует: [`did_action`](https://chugunov.pro/api-wordpress/functions/did_action/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: [`_make_clickable_rel_attr`](https://chugunov.pro/api-wordpress/functions/_make_clickable_rel_attr/), [`make_clickable`](https://chugunov.pro/api-wordpress/functions/make_clickable/), [`wp_is_internal_link`](https://chugunov.pro/api-wordpress/functions/wp_is_internal_link/), [`wp_rel_callback`](https://chugunov.pro/api-wordpress/functions/wp_rel_callback/), [`wp_filter_oembed_iframe_title_attribute`](https://chugunov.pro/api-wordpress/functions/wp_filter_oembed_iframe_title_attribute/), [`wp_targeted_link_rel_callback`](https://chugunov.pro/api-wordpress/functions/wp_targeted_link_rel_callback/), [`wp_kses_one_attr`](https://chugunov.pro/api-wordpress/functions/wp_kses_one_attr/), [`edit_user`](https://chugunov.pro/api-wordpress/functions/edit_user/), [`_links_add_base`](https://chugunov.pro/api-wordpress/functions/_links_add_base/), [`esc_url`](https://chugunov.pro/api-wordpress/functions/esc_url/), [`safecss_filter_attr`](https://chugunov.pro/api-wordpress/functions/safecss_filter_attr/), [`wp_kses`](https://chugunov.pro/api-wordpress/functions/wp_kses/).

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