Alert: 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.

_restore_wpautop_hook() WordPress Function

The restore_wpautop_hook() function is used to filter the content after the autop filter has been applied. This function is useful for restoring any shortcodes that have been filtered out by the autop filter.

_restore_wpautop_hook( string $content ) #

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


Parameters

$content

(string)(Required)The post content running through this filter.


Top ↑

Return

(string) The unmodified content.


Top ↑

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


Top ↑

Changelog

Changelog
VersionDescription
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.