Handles parsing errors in wp_kses_hair().
The general plan is to remove everything to and including some whitespace, but it deals with quotes and apostrophes as well.
$attrstringrequired
function wp_kses_html_error( $attr ) {
return preg_replace( '/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $attr );
}
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_kses_html_error