WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_REST_Authentication::send_unauthorized_headers() public WC 1.0

If the consumer_key and consumer_secret $_GET parameters are NOT provided and the Basic auth headers are either not present or the consumer secret does not match the consumer key provided, then return the correct Basic headers and an error message.

{} Это метод класса: WC_REST_Authentication{}

Хуков нет.




$WC_REST_Authentication = new WC_REST_Authentication();
$WC_REST_Authentication->send_unauthorized_headers( $response );
$response(WP_REST_Response) (обязательный)
Current response being served.

Код WC_REST_Authentication::send_unauthorized_headers() WC 6.1.1

public function send_unauthorized_headers( $response ) {
	if ( is_wp_error( $this->get_error() ) && 'basic_auth' === $this->auth_method ) {
		$auth_message = __( 'WooCommerce API. Use a consumer key in the username field and a consumer secret in the password field.', 'woocommerce' );
		$response->header( 'WWW-Authenticate', 'Basic realm="' . $auth_message . '"', true );

	return $response;