WordPress开发者和主题制作者的搜索引擎



convert_chars ›

Since0.71
已弃用n/a
convert_chars ( $content, $deprecated = '' )
参数: (2)
  • (string) $content String of characters to be converted.
    Required: Yes
  • (string) $deprecated Not used.
    Required: No
    默认: (empty)
返回:
  • (string) Converted string.
定义在:
文档:

Converts lone & characters into `&` (a.k.a. `&`)



源码

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;
}