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

You appear to be a bot. Output may be restricted

Description

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

Usage

$string = _restore_wpautop_hook( $content );

Parameters

$content
( string ) required – The post content running through this filter.

Returns

string The unmodified content.

Source

File name: wordpress/wp-includes/blocks.php
Lines:

1 to 8 of 8
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;
}
 

 View on GitHub View on Trac