esc_url_raw

Performs esc_url() for database usage.

Description

(string) esc_url_raw( (string) $url, (null) $protocols = null ); 

Returns (string)

The cleaned URL.

Parameters (2)

0. $url (string)
The URL to be cleaned.
1. $protocols — Optional. (null) => null
An array of acceptable protocols.

Usage

  1. if ( !function_exists( 'esc_url_raw' ) ) { 
  2. require_once ABSPATH . WPINC . '/formatting.php'; 
  3.  
  4. // The URL to be cleaned. 
  5. $url = ''; 
  6.  
  7. // An array of acceptable protocols. 
  8. $protocols = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = esc_url_raw($url, $protocols); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/formatting.php  
  1. function esc_url_raw( $url, $protocols = null ) { 
  2. return esc_url( $url, $protocols, 'db' );