Alert: 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.

_autop_newline_preservation_helper() WordPress Function

The autop_newline_preservation_helper() function is used to preserve newlines in the content when converting it to HTML. This is useful when you want to preserve the structure of the content, such as when creating a list.

_autop_newline_preservation_helper( array $matches ) #

Newline preservation help function for wpautop().


Parameters

$matches

(array)(Required)preg_replace_callback matches array


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/formatting.php

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

Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More