wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



_restore_wpautop_hook › WordPress Function

Od5.0.0
Przestarzałyn/a
_restore_wpautop_hook ( $content )
Dostęp:
  • private
Parametry:
  • (string) $content The post content running through this filter.
    Wymagane: Tak
Powrót:
  • (string) The unmodified content.
Zdefiniowane na:
Codex:

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



Źródło

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