转换孤独
原型
convert_chars( string $content, string $deprecated = '' )
参数
$content
(string)
(Required)
要转换的字符串。
$deprecated
(string)
(Optional)
不曾用过。
返回值
(string)
转换后的字符串。
源文件
路径:wp-includes/formatting.php
<?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;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/convert_chars/