WordPress at a glance
function is not described

WP_Text_Diff_Renderer_inline::_splitOnWords() public WP 2.6.0

{} It's a method of the class: WP_Text_Diff_Renderer_inline{}

No Hooks.

Return

String.

Usage

$WP_Text_Diff_Renderer_inline = new WP_Text_Diff_Renderer_inline();
$WP_Text_Diff_Renderer_inline->_splitOnWords( $string, $newlineEscape );
$string(string) (required)
-
$newlineEscape(string)
-

Changelog

Since 2.6.0 Introduced.

Code of WP_Text_Diff_Renderer_inline::_splitOnWords() WP 5.7.2

<?php
public function _splitOnWords( $string, $newlineEscape = "\n" ) {
	$string = str_replace( "\0", '', $string );
	$words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
	$words  = str_replace( "\n", $newlineEscape, $words );
	return $words;
}