_restore_wpautop_hook()WP 5.0.0

If do_blocks() needs to remove wpautop() from the the_content this re-adds it afterwards, for subsequent the_content

Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.

Хуков нет.

Возвращает

Строку. The unmodified content.

Использование

_restore_wpautop_hook( $content );
$content(строка) (обязательный)
The post content running through this filter.

Список изменений

С версии 5.0.0 Введена.

Код _restore_wpautop_hook() WP 6.5.2

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;
}