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

Converts lone & characters into & (a.k.a. &)


Parameters

$content

(Required) String of characters to be converted.

$deprecated

(Optional) Not used.

Default value: ''


Return

(string) Converted string.


Source

File: wp-includes/formatting.php

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

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

	return $content;
}


Changelog

Changelog
Version Description
WP-0.71 Introduced.