WC_Helper_Updater::is_temporary_failure │ private static │ WC 1.0

Whether a failed update check may succeed if retried. Only a rejected connection is not: a 401 or 403, or a WP_Error for missing local credentials.

Метод класса: WC_Helper_Updater{}

Хуков нет.

Возвращает

bool.

Использование

$result = WC_Helper_Updater::is_temporary_failure( $request, $response_code ): bool;
$request(массив|WP_Error) (обязательный)
The update-check response.
$response_code(int) (обязательный)
The HTTP status code, 0 when there is none.

Код WC_Helper_Updater::is_temporary_failure() WC 11.3.0

private static function is_temporary_failure( $request, int $response_code ): bool {
	if ( is_wp_error( $request ) ) {
		return 'authentication' !== $request->get_error_code();
	}

	return ! in_array( $response_code, array( 401, 403 ), true );
}