convert_chars( string   $content , string   $deprecated = '' ): string

Convers lone & characters into & (a.c.a. & )

Parameters

$content string required
String of characters to be converted.
$deprecated string optional
Not used.

Default: ''

Return

string Converted string.

Source

function convert_chars( $content, $deprecated = '' ) {
	if ( ! empty( $deprecated ) ) {
		_deprecated_argument( __FUNCTION__, '0.71' );
	}

	if ( str_contains( $content, '&' ) ) {
		$content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content );
	}

	return $content;
}

Changuelog

Versionen Description
0.71 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.