функция since 5.0.0

_restore_wpautop_hook()

Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.

Сигнатура

_restore_wpautop_hook( string $content ): string

Описание

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

Параметры

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

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

string

Исходный код

wp-includes/blocks.php:2545

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.

Что будем искать? Например,Продвижение