wpseek.com
A WordPress-centric search engine for devs and theme authors



sanitize_url › WordPress Function

Since2.3.1
Deprecatedn/a
sanitize_url ( $url, $protocols = null )
Parameters: (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
    Default: null
See:
Returns:
  • (string) The cleaned URL after esc_url() is run with the 'db' context.
Defined at:
Codex:
Change Log:
  • 2.8.0
  • 5.9.0

Sanitizes a URL for database or redirect usage.



Source

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