WordPress at Your Fingertips
function is not described

WC_Product_Variation::get_variation_attributes() public WC 1.0

Get variation attribute values. Keys are prefixed with attribute_, as stored, unless $with_prefix is false.

{} It's a method of the class: WC_Product_Variation{}

No Hooks.

Return

Array. of attributes and their values for this variation.

Usage

$WC_Product_Variation = new WC_Product_Variation();
$WC_Product_Variation->get_variation_attributes( $with_prefix );
$with_prefix(true|false)
Whether keys should be prepended with attribute_ or not.
Default: true

Code of WC_Product_Variation::get_variation_attributes() WC 5.7.1

public function get_variation_attributes( $with_prefix = true ) {
	$attributes           = $this->get_attributes();
	$variation_attributes = array();
	$prefix               = $with_prefix ? 'attribute_' : '';

	foreach ( $attributes as $key => $value ) {
		$variation_attributes[ $prefix . $key ] = $value;
	}
	return $variation_attributes;
}