esc_url_raw

函式
esc_url_raw ( $url, $protocols = null )
引數
  • (string) $url The URL to be cleaned.
    Required:
  • (string[]) $protocols Optional. An array of acceptable protocols. Defaults to return value of wp_allowed_protocols().
    Required:
    Default: null
返回值
  • (string) The cleaned URL after sanitize_url() is run.
相關
  • sanitize_url()
定義位置
相關方法
esc_urlrest_urlesc_html__esc_html_eesc_html_x
引入
2.8.0
棄用
-

esc_url_raw: 這個函式用來轉義一個URL,用於查詢字串引數。

對資料庫或重定向使用的URL進行淨化。

這個函式是sanitize_url()的一個別名。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function esc_url_raw( $url, $protocols = null ) {
return sanitize_url( $url, $protocols );
}
function esc_url_raw( $url, $protocols = null ) { return sanitize_url( $url, $protocols ); }
function esc_url_raw( $url, $protocols = null ) {
	return sanitize_url( $url, $protocols );
}

常見問題

FAQs
檢視更多 >