wp_pre_kses_less_than_callback() WordPress Function
The wp_pre_kses_less_than_callback() function is used to pre-filter content before it is passed through the kses post filter. This function is called by the wp_pre_kses() function. The function strips out all '<' characters and replaces them with '<'. This is done to prevent content from being passed to the kses filter that could potentially create security vulnerabilities.
wp_pre_kses_less_than_callback( string[] $matches ) #
Callback function used by preg_replace.
Parameters
- $matches
(string[])(Required)Populated by matches to preg_replace.
Return
(string) The text returned after esc_html if needed.
Source
File: wp-includes/formatting.php
function wp_pre_kses_less_than_callback( $matches ) { if ( false === strpos( $matches[0], '>' ) ) { return esc_html( $matches[0] ); } return $matches[0]; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |