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_`
|
||||
$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 ) ),
|
||||
'option' => $attribute,
|
||||
);
|
||||
|
@ -2490,7 +2490,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
$attributes[] = array(
|
||||
'name' => wc_attribute_label( $attribute['name'] ),
|
||||
'name' => wc_attribute_label( $attribute['name'], $product ),
|
||||
'slug' => str_replace( 'pa_', '', $attribute['name'] ),
|
||||
'position' => (int) $attribute['position'],
|
||||
'visible' => (bool) $attribute['is_visible'],
|
||||
|
|
Loading…
Reference in New Issue