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



sanitize_url ›

Since2.3.1
已弃用2.8.0
sanitize_url ( $url, $protocols = null )
参数: (2)
  • (string) $url The URL to be cleaned.
    Required: Yes
  • (array) $protocols An array of acceptable protocols.
    Required: No
    默认: null
查看:
返回:
  • (string) The cleaned URL.
定义在:
文档:

Performs esc_url() for database or redirect usage.



源码

function sanitize_url( $url, $protocols = null ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_url_raw()' );
	return esc_url_raw( $url, $protocols );
}