On this page
convert_chars( string $content, string $deprecated = '' ): string
Converts lone & characters into & (a.k.a. &)
Parameters
$contentstring Required-
String of characters to be converted.
$deprecatedstring Optional-
Not used.
Default:
''
Return
string Converted string.
Source
File: wp-includes/formatting.php. View all references
function convert_chars( $content, $deprecated = '' ) {
if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '0.71' );
}
if ( strpos( $content, '&' ) !== false ) {
$content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content );
}
return $content;
}
Related
Uses
| Uses | Description |
|---|---|
| _deprecated_argument() wp-includes/functions.php | Marks a function argument as deprecated and inform when it has been used. |
Used By
| Used By | Description |
|---|---|
| atom_site_icon() wp-includes/feed.php | Displays Site Icon in atom feeds. |
| rss2_site_icon() wp-includes/feed.php | Displays Site Icon in RSS2. |
| wp_richedit_pre() wp-includes/deprecated.php | Formats text for the rich text editor. |
| get_bloginfo_rss() wp-includes/feed.php | Retrieves RSS container for the bloginfo function. |
Changelog
| Version | Description |
|---|---|
| 0.71 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/convert_chars