wp_is_site_protected_by_basic_auth
Filters whether a site is protected by HTTP Basic Auth.
Usage
add_filter( 'wp_is_site_protected_by_basic_auth', 'wp_kama_is_site_protected_by_basic_auth_filter', 10, 2 );
/**
* Function for `wp_is_site_protected_by_basic_auth` filter-hook.
*
* @param bool $is_protected Whether the site is protected by Basic Auth.
* @param string $context The context to check for protection. One of 'login', 'admin', or 'front'.
*
* @return bool
*/
function wp_kama_is_site_protected_by_basic_auth_filter( $is_protected, $context ){
// filter...
return $is_protected;
}
- $is_protected(true|false)
- Whether the site is protected by Basic Auth.
- $context(string)
- The context to check for protection. One of 'login', 'admin', or 'front'.
Changelog
| Since 5.6.1 | Introduced. |
Where the hook is called
wp_is_site_protected_by_basic_auth
wp-includes/load.php 2046
return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );