# is_protected_endpoint()

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

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

## Сигнатура

```php
is_protected_endpoint(): bool
```

## Описание

Определяет, находимся ли мы сейчас на конечной точке, которую следует защищать от «белого экрана смерти» (WSOD).

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

`bool`

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

Файл: `wp-includes/load.php:1180`

```php
function is_protected_endpoint() {
	// Protect login pages.
	if ( isset( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {
		return true;
	}

	// Protect the admin backend.
	if ( is_admin() && ! wp_doing_ajax() ) {
		return true;
	}

	// Protect Ajax actions that could help resolve a fatal error should be available.
	if ( is_protected_ajax_action() ) {
		return true;
	}

	/**
	 * Filters whether the current request is against a protected endpoint.
	 *
	 * This filter is only fired when an endpoint is requested which is not already protected by
	 * WordPress core. As such, it exclusively allows providing further protected endpoints in
	 * addition to the admin backend, login pages and protected Ajax actions.
	 *
	 * @since 5.2.0
	 *
	 * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected.
	 *                                    Default false.
	 */
	return (bool) apply_filters( 'is_protected_endpoint', false );
}
```

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

- 5.2.0 — Introduced.

## Связанные

Использует: [`is_protected_ajax_action`](https://chugunov.pro/api-wordpress/functions/is_protected_ajax_action/), [`wp_doing_ajax`](https://chugunov.pro/api-wordpress/functions/wp_doing_ajax/), [`is_admin`](https://chugunov.pro/api-wordpress/functions/is_admin/), [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `WP_Recovery_Mode::handle_error`, `WP_Fatal_Error_Handler::display_default_error_template`.

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