wp_is_site_protected_by_basic_auth

FUNCTION wp-includes\load.php (ligne 2005) github
Checks if this site is protected by HTTP Basic Auth. At the moment, this merely checks for the present of Basic Auth credentials. Therefore, calling this function with a context different from the current context may give inaccurate results. In a future release, this evaluation may be made more robust. Currently, this is only used by Application Passwords to prevent a conflict since it also utilizes Basic Auth.

Paramètres

Entrée :
$context = ''
Sortie :
@param string $context The context to check for protection. Accepts 'login', 'admin', and 'front'.
@return bool Whether the site is protected by Basic Auth.

Utilisation

// Utilisation de la fonction wp_is_site_protected_by_basic_auth
$result = wp_is_site_protected_by_basic_auth($context = '');

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...