WordPress at a glance
function is not described

wc_get_attribute() WC 3.2.0

Get attribute data by ID.

No Hooks.

Return

stdClass|null. Nothing.

Usage

wc_get_attribute( $id );
$id(int) (required)
Attribute ID.

Changelog

Since 3.2.0 Introduced.

Code of wc_get_attribute() WC 5.2.2

<?php
function wc_get_attribute( $id ) {
	$attributes = wc_get_attribute_taxonomies();

	if ( ! isset( $attributes[ 'id:' . $id ] ) ) {
		return null;
	}

	$data                    = $attributes[ 'id:' . $id ];
	$attribute               = new stdClass();
	$attribute->id           = (int) $data->attribute_id;
	$attribute->name         = $data->attribute_label;
	$attribute->slug         = wc_attribute_taxonomy_name( $data->attribute_name );
	$attribute->type         = $data->attribute_type;
	$attribute->order_by     = $data->attribute_orderby;
	$attribute->has_archives = (bool) $data->attribute_public;
	return $attribute;
}