_autop_newline_preservation_helper()WP 3.1.0

Newline preservation help function for wpautop().

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String.

Usage

_autop_newline_preservation_helper( $matches );
$matches(array) (required)
preg_replace_callback matches array

Changelog

Since 3.1.0 Introduced.

_autop_newline_preservation_helper() code WP 6.5.2

function _autop_newline_preservation_helper( $matches ) {
	return str_replace( "\n", '<WPPreserveNewline />', $matches[0] );
}