parent
c5ccc65856
commit
48fabea5b0
|
@ -2472,7 +2472,7 @@ class WC_API_Products extends WC_API_Resource {
|
||||||
|
|
||||||
// taxonomy-based attributes are prefixed with `pa_`, otherwise simply `attribute_`
|
// taxonomy-based attributes are prefixed with `pa_`, otherwise simply `attribute_`
|
||||||
$attributes[] = array(
|
$attributes[] = array(
|
||||||
'name' => wc_attribute_label( str_replace( 'attribute_', '', $attribute_name ) ),
|
'name' => wc_attribute_label( str_replace( 'attribute_', '', $attribute_name ), $product ),
|
||||||
'slug' => str_replace( 'attribute_', '', str_replace( 'pa_', '', $attribute_name ) ),
|
'slug' => str_replace( 'attribute_', '', str_replace( 'pa_', '', $attribute_name ) ),
|
||||||
'option' => $attribute,
|
'option' => $attribute,
|
||||||
);
|
);
|
||||||
|
@ -2490,7 +2490,7 @@ class WC_API_Products extends WC_API_Resource {
|
||||||
}
|
}
|
||||||
|
|
||||||
$attributes[] = array(
|
$attributes[] = array(
|
||||||
'name' => wc_attribute_label( $attribute['name'] ),
|
'name' => wc_attribute_label( $attribute['name'], $product ),
|
||||||
'slug' => str_replace( 'pa_', '', $attribute['name'] ),
|
'slug' => str_replace( 'pa_', '', $attribute['name'] ),
|
||||||
'position' => (int) $attribute['position'],
|
'position' => (int) $attribute['position'],
|
||||||
'visible' => (bool) $attribute['is_visible'],
|
'visible' => (bool) $attribute['is_visible'],
|
||||||
|
|
Loading…
Reference in New Issue