WordPress at a glance
function is not described

htmlentities2() WP 1.2.2

Convert entities, while preserving already-encoded entities.

No Hooks.

Return

String. Converted text.

Usage

htmlentities2( $myHTML );
$myHTML(string) (required)
The text to be converted.

Code of htmlentities2: wp-includes/formatting.php WP 5.2.2

<?php
function htmlentities2( $myHTML ) {
	$translation_table              = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
	$translation_table[ chr( 38 ) ] = '&';
	return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&amp;', strtr( $myHTML, $translation_table ) );
}