wp_is_site_protected_by_basic_auth

過濾鉤子
apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context )
引數
  • (bool) $is_protected Whether the site is protected by Basic Auth.
    Required:
  • (string) $context The context to check for protection. One of 'login', 'admin', or 'front'.
    Required:
定義位置
相關勾子
wp_protected_ajax_actionsis_protected_endpointis_protected_metapre_get_site_by_pathwp_sitemaps_posts_query_args
相關方法
wp_is_site_protected_by_basic_authis_protected_ajax_actionwp_is_site_url_using_https_wp_die_process_inputis_protected_endpointis_protected_meta
引入
5.6.1
棄用
-

wp_is_site_protected_by_basic_auth:此功能檢查站點是否受基本身份驗證保護。基本身份驗證是一種身份驗證機制,需要使用者提供使用者名稱和密碼才能訪問站點。true如果站點受基本身份驗證保護,則此函式返回,否則返回false。

過濾一個網站是否受到HTTP Basic Auth的保護。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );
return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );
return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );

常見問題

FAQs
檢視更多 >