wp_pre_kses_less_than_callback()WP 2.3.0

Callback function used by preg_replace.

No Hooks.

Return

String. The text returned after esc_html if needed.

Usage

wp_pre_kses_less_than_callback( $matches );
$matches(string[]) (required)
Populated by matches to preg_replace.

Changelog

Since 2.3.0 Introduced.

wp_pre_kses_less_than_callback() code WP 6.5.2

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