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的保护。

return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 16:32:56

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: