函数原型
convert_chars( string $content, string $deprecated = ” ): string
函数描述
Converts lone & characters into & (a.k.a. &)
是否弃用
未弃用
函数参数
-
$content
string
Required - String of characters to be converted.
-
$deprecated
string
Optional - Not used.
Default:
''
函数返回值
string Converted string.
函数位置
File: wp-includes/formatting.php.
函数源码
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 0.71 | Introduced. |

