Skip to content

Commit 3ccbb8c

Browse files
Fixed examples of update categories
1 parent bf6d68b commit 3ccbb8c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

Diff for: source/includes/wp-api-v1/_product-categories.md

+5-15
Original file line numberDiff line numberDiff line change
@@ -470,17 +470,13 @@ curl -X PUT https://example.com/wp-json/wc/v1/products/categories/9 \
470470
-u consumer_key:consumer_secret \
471471
-H "Content-Type: application/json" \
472472
-d '{
473-
"product_category": {
474-
"description": "All kinds of clothes."
475-
}
473+
"description": "All kinds of clothes."
476474
}'
477475
```
478476

479477
```javascript
480478
var data = {
481-
product_category: {
482-
description: 'All kinds of clothes.'
483-
}
479+
description: 'All kinds of clothes.'
484480
};
485481

486482
WooCommerce.put('products/categories/9', data, function(err, data, res) {
@@ -491,9 +487,7 @@ WooCommerce.put('products/categories/9', data, function(err, data, res) {
491487
```php
492488
<?php
493489
$data = [
494-
'product_category' => [
495-
'description' => 'All kinds of clothes.'
496-
]
490+
'description' => 'All kinds of clothes.'
497491
];
498492

499493
print_r($woocommerce->put('products/categories/9', $data));
@@ -502,19 +496,15 @@ print_r($woocommerce->put('products/categories/9', $data));
502496

503497
```python
504498
data = {
505-
"product_category": {
506-
"description": "All kinds of clothes."
507-
}
499+
"description": "All kinds of clothes."
508500
}
509501

510502
print(wcapi.put("products/categories/9", data).json())
511503
```
512504

513505
```ruby
514506
data = {
515-
product_category: {
516-
description: "All kinds of clothes."
517-
}
507+
description: "All kinds of clothes."
518508
}
519509

520510
woocommerce.put("products/categories/9", data).parsed_response

0 commit comments

Comments
 (0)