Filter hook 'wp_is_site_protected_by_basic_auth'

in WP Core File wp-includes/load.php at line 2042

View Source

wp_is_site_protected_by_basic_auth

Filter Hook
Description
Filters whether a site is protected by HTTP Basic Auth.

Hook Information

File Location wp-includes/load.php View on GitHub
Hook Type Filter
Line Number 2042

Hook Parameters

Type Name Description
bool $is_protected Whether the site is protected by Basic Auth.
string $context The context to check for protection. One of 'login', 'admin', or 'front'.

Usage Examples

Basic Usage
<?php
// Hook into wp_is_site_protected_by_basic_auth
add_filter('wp_is_site_protected_by_basic_auth', 'my_custom_filter', 10, 2);

function my_custom_filter($is_protected, $context) {
    // Your custom filtering logic here
    return $is_protected;
}

Source Code Context

wp-includes/load.php:2042 - How this hook is used in WordPress core
<?php
2037  	 * @since 5.6.1
2038  	 *
2039  	 * @param bool $is_protected Whether the site is protected by Basic Auth.
2040  	 * @param string $context    The context to check for protection. One of 'login', 'admin', or 'front'.
2041  	 */
2042  	return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context );
2043  }

PHP Documentation

<?php
/**
	 * Filters whether a site is protected by HTTP Basic Auth.
	 *
	 * @since 5.6.1
	 *
	 * @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'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/load.php
Related Hooks

Related hooks will be displayed here in future updates.