WP_HTTP_Proxy::use_authentication()publicWP 2.8.0

Whether authentication should be used.

Constants which control this behavior:

  • WP_PROXY_USERNAME
  • WP_PROXY_PASSWORD

Method of the class: WP_HTTP_Proxy{}

No Hooks.

Return

true|false.

Usage

$WP_HTTP_Proxy = new WP_HTTP_Proxy();
$WP_HTTP_Proxy->use_authentication();

Changelog

Since 2.8.0 Introduced.

WP_HTTP_Proxy::use_authentication() code WP 6.5.2

public function use_authentication() {
	return defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' );
}