WP_Text_Diff_Renderer_inline::_splitOnWords()publicWP 2.6.0

Метод класса: 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)
-
Default: "\n"

Changelog

Since 2.6.0 Introduced.

Код WP_Text_Diff_Renderer_inline::_splitOnWords() WP 6.1.1

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