Warning: This function has been deprecated. Use esc_url_raw() instead.
sanitize_url( string $url, array $protocols = null )
Performs esc_url() for database or redirect usage.
Description Description
See also See also
Parameters Parameters
- $url
-
(string) (Required) The URL to be cleaned.
- $protocols
-
(array) (Optional) An array of acceptable protocols.
Default value: null
Return Return
(string) The cleaned URL.
Source Source
File: wp-includes/deprecated.php
function sanitize_url( $url, $protocols = null ) { _deprecated_function( __FUNCTION__, '2.8.0', 'esc_url_raw()' ); return esc_url_raw( $url, $protocols ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.8.0 | Use esc_url_raw() |
2.3.1 | Introduced. |