函数原型
esc_url_raw( string $url, string[] $protocols = null ): string
函数描述
Sanitizes a URL for database or redirect usage.
是否弃用
未弃用
函数参数
-
$url
string
Required - The URL to be cleaned.
-
$protocols
string[]
Optional - An array of acceptable protocols.
Defaults to return value of wp_allowed_protocols() .Default:
null
函数返回值
string The cleaned URL after sanitize_url() is run.
函数位置
File: wp-includes/formatting.php.
函数源码
function esc_url_raw( $url, $protocols = null ) {
return sanitize_url( $url, $protocols );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 6.1.0 | Turned into an alias for sanitize_url() . |
| 2.8.0 | Introduced. |

