_restore_wpautop_hook

Advertisement

Private Access Private Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Summery Summery

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

Syntax Syntax

_restore_wpautop_hook( string $content )

Parameters Parameters

$content

(Required) The post content running through this filter.

Return Return

(string) The unmodified content.

Source Source

File: wp-includes/blocks.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;
}

Advertisement

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Advertisement

Leave a Reply