A WordPress-centric search engine for devs and theme authors



sanitize_url ›

Since2.3.1
Deprecated2.8.0
sanitize_url ( $url, $protocols = null )
Parameters: (2)
  • (string) $url The URL to be cleaned.
    Required: Yes
  • (array) $protocols An array of acceptable protocols.
    Required: No
    Default: null
See:
Returns:
  • (string) The cleaned URL.
Defined at:
Codex:

Performs esc_url() for database or redirect usage.



Source

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