esc_url_raw

The timeline below displays how wordpress function esc_url_raw has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Sanitizes a URL for database or redirect usage.
 *
 * This function is an alias for sanitize_url().
 *
 * @since 2.8.0
 * @since 6.1.0 Turned into an alias for sanitize_url().
 *
 * @see sanitize_url()
 *
 * @param string   $url       The URL to be cleaned.
 * @param string[] $protocols Optional. An array of acceptable protocols.
 *                            Defaults to return value of wp_allowed_protocols().
 * @return string The cleaned URL after sanitize_url() is run.
 */
function esc_url_raw($url, $protocols = null)
{
    return sanitize_url($url, $protocols);
}

WordPress Version: 5.9

/**
 * Performs esc_url() for database or redirect usage.
 *
 * @since 2.8.0
 *
 * @see esc_url()
 *
 * @param string   $url       The URL to be cleaned.
 * @param string[] $protocols Optional. An array of acceptable protocols.
 *                            Defaults to return value of wp_allowed_protocols().
 * @return string The cleaned URL after esc_url() is run with the 'db' context.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 5.6

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 *
 * @see esc_url()
 *
 * @param string   $url       The URL to be cleaned.
 * @param string[] $protocols Optional. An array of acceptable protocols.
 *                            Defaults to return value of wp_allowed_protocols().
 * @return string The cleaned URL after esc_url() is run with the 'db' context.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 5.5

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 *
 * @param string   $url       The URL to be cleaned.
 * @param string[] $protocols Optional. An array of acceptable protocols.
 *                            Defaults to return value of wp_allowed_protocols().
 * @return string The cleaned URL.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 5.4

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 *
 * @param string   $url       The URL to be cleaned.
 * @param string[] $protocols An array of acceptable protocols.
 * @return string The cleaned URL.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 4.3

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 *
 * @param string $url       The URL to be cleaned.
 * @param array  $protocols An array of acceptable protocols.
 * @return string The cleaned URL.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 4.1

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 *
 * @param string $url The URL to be cleaned.
 * @param array $protocols An array of acceptable protocols.
 * @return string The cleaned URL.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}

WordPress Version: 3.7

/**
 * Performs esc_url() for database usage.
 *
 * @since 2.8.0
 * @uses esc_url()
 *
 * @param string $url The URL to be cleaned.
 * @param array $protocols An array of acceptable protocols.
 * @return string The cleaned URL.
 */
function esc_url_raw($url, $protocols = null)
{
    return esc_url($url, $protocols, 'db');
}