# wp_is_local_html_output()

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

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

## Сигнатура

```php
wp_is_local_html_output( string $html ): bool|null
```

## Описание

Эта функция пытается проверить наличие в HTML-строке различных типичных для WordPress паттернов.
Поскольку любое из этих действий может быть отключено сторонним кодом, функция также может вернуть null, указывая на то, что определить принадлежность не удалось.

## Параметры

- `$html` `string` — обязательный. Полная строка HTML-вывода, например из HTTP-ответа.

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

`bool|null`

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

Файл: `wp-includes/https-detection.php:173`

```php
function wp_is_local_html_output( $html ) {
	// 1. Check if HTML includes the site's Really Simple Discovery link.
	if ( has_action( 'wp_head', 'rsd_link' ) ) {
		$pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) ); // See rsd_link().
		return str_contains( $html, $pattern );
	}

	// 2. Check if HTML includes the site's REST API link.
	if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) {
		// Try both HTTPS and HTTP since the URL depends on context.
		$pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head().
		return str_contains( $html, $pattern );
	}

	// Otherwise the result cannot be determined.
	return null;
}
```

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

- 5.7.0 — Introduced.

## Связанные

Использует: [`get_rest_url`](https://chugunov.pro/api-wordpress/functions/get_rest_url/), [`site_url`](https://chugunov.pro/api-wordpress/functions/site_url/), [`has_action`](https://chugunov.pro/api-wordpress/functions/has_action/), [`esc_url`](https://chugunov.pro/api-wordpress/functions/esc_url/).
Используется в: [`wp_get_https_detection_errors`](https://chugunov.pro/api-wordpress/functions/wp_get_https_detection_errors/).

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