_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.

Returns

String. Text with newlines replaced with placeholders.

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 7.0

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