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



sanitize_url › WordPress Function

Since2.3.1
已弃用n/a
sanitize_url ( $url, $protocols = null )
参数: (2)
  • (string) $url The URL to be cleaned.
    Required: Yes
  • (string[]) $protocols Optional. An array of acceptable protocols. Defaults to return value of wp_allowed_protocols().
    Required: No
    默认: null
查看:
返回:
  • (string) The cleaned URL after esc_url() is run with the 'db' context.
定义在:
文档:
Change Log:
  • 2.8.0
  • 5.9.0

Sanitizes a URL for database or redirect usage.



源码

function sanitize_url( $url, $protocols = null ) {
	return esc_url( $url, $protocols, 'db' );
}