wp_pre_kses_less_than_callback( string[] $matches ): string

In this article

Callback function used by preg_replace.

Parameters

$matchesstring[]required
Populated by matches to preg_replace.

Return

string The text returned after esc_html if needed.

Source

function wp_pre_kses_less_than_callback( $matches ) {
	if ( ! str_contains( $matches[0], '>' ) ) {
		return esc_html( $matches[0] );
	}
	return $matches[0];
}

Changelog

VersionDescription
2.3.0Introduced.

User Contributed Notes

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