convert_chars()
Converts lone & characters into & (a.k.a. &)
No Hooks.
Returns
String. Converted string.
Usage
convert_chars( $content, $deprecated );
- $content(string) (required)
- String of characters to be converted.
- $deprecated(string)
- Not used.
Default:''
Changelog
| Since 0.71 | Introduced. |
convert_chars() convert chars code WP 6.9.1
function convert_chars( $content, $deprecated = '' ) {
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '0.71' );
}
if ( str_contains( $content, '&' ) ) {
$content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content );
}
return $content;
}