On this page
_restore_wpautop_hook( string $content ): string
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.
If do_blocks() needs to remove wpautop() from the the_content filter, this re-adds it afterwards, for subsequent the_content usage.
Parameters
$contentstring Required-
The post content running through this filter.
Return
string The unmodified content.
Source
File: wp-includes/blocks.php. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| has_filter() wp-includes/plugin.php | Checks if any filter has been registered for a hook. |
| remove_filter() wp-includes/plugin.php | Removes a callback function from a filter hook. |
| add_filter() wp-includes/plugin.php | Adds a callback function to a filter hook. |
Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/_restore_wpautop_hook