# _restore_wpautop_hook()

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

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

## Сигнатура

```php
_restore_wpautop_hook( string $content ): string
```

## Описание

Если do_blocks() требуется удалить wpautop() из фильтра `the_content`, эта функция затем добавляет его обратно для последующего использования `the_content`.

## Параметры

- `$content` `string` — обязательный. Содержимое записи, проходящее через этот фильтр.

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

`string`

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

Файл: `wp-includes/blocks.php:2545`

```php
function _restore_wpautop_hook( $content ) {
	$current_priority = has_filter( 'the_content', '_restore_wpautop_hook' );

	add_filter( 'the_content', 'wpautop', $current_priority - 1 );
	remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );

	return $content;
}
```

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

- 5.0.0 — Introduced.

## Связанные

Использует: [`has_filter`](https://chugunov.pro/api-wordpress/functions/has_filter/), [`add_filter`](https://chugunov.pro/api-wordpress/functions/add_filter/), [`remove_filter`](https://chugunov.pro/api-wordpress/functions/remove_filter/).

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