WC_REST_Authentication::set_error()protectedWC 1.0

Set authentication error.

Method of the class: WC_REST_Authentication{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->set_error( $error );
$error(WP_Error) (required)
Authentication error data.

WC_REST_Authentication::set_error() code WC 8.7.0

protected function set_error( $error ) {
	// Reset user.
	$this->user = null;

	$this->error = $error;
}