http_request_host_is_external

過濾鉤子
apply_filters( 'http_request_host_is_external', false, $host, $url )
引數
  • (bool) $external Whether HTTP request is external or not.
    Required:
  • (string) $host Host name of the requested URL.
    Required:
  • (string) $url Requested URL.
    Required:
定義位置
相關勾子
http_request_timeouthttp_request_versionhttp_request_argshttp_request_reject_unsafe_urlsoembed_request_post_id
相關方法
allowed_http_request_hostsms_allowed_http_request_hostswp_restore_post_revision_wp_get_post_revision_versionwp_get_post_termswp_set_post_terms
引入
3.6.0
棄用
-

http_request_host_is_external是一個過濾鉤,允許你修改wp_http_validate_url函式的結果,該函式用於確定一個主機是否被視為”外部”。如果一個主機與當前網站的主機不一樣,它就被認為是外部的。這個過濾器可以用來修改一個主機是否被認為是外部的判斷。

檢查HTTP請求是否為外部請求。

允許改變和允許HTTP請求的外部請求。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {
if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {
if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) {

常見問題

FAQs
檢視更多 >