Skip to content

Commit 9288ae0

Browse files
committed
Clarifications about adding images to products
Fixes woocommerce/woocommerce#43647
1 parent 8421caa commit 9288ae0

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

source/includes/wp-api-v3/_products.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The products API allows you to create, view, update, and delete individual, or a
108108

109109
| Attribute | Type | Description |
110110
|---------------------|-----------|---------------------------------------------------------------------------------------------------------|
111-
| `id` | integer | Image ID. |
111+
| `id` | integer | The attachment ID from the Media Library. |
112112
| `date_created` | date-time | The date the image was created, in the site's timezone. <i class="label label-info">read-only</i> |
113113
| `date_created_gmt` | date-time | The date the image was created, as GMT. <i class="label label-info">read-only</i> |
114114
| `date_modified` | date-time | The date the image was last modified, in the site's timezone. <i class="label label-info">read-only</i> |
@@ -157,7 +157,7 @@ This API helps you to create a new product.
157157
</div>
158158
</div>
159159

160-
> Example of how to create a `simple` product:
160+
> Example of how to create a `simple` product with one existing image and one new image:
161161
162162
```shell
163163
curl -X POST https://example.com/wp-json/wc/v3/products \
@@ -179,7 +179,7 @@ curl -X POST https://example.com/wp-json/wc/v3/products \
179179
],
180180
"images": [
181181
{
182-
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
182+
"id": 42
183183
},
184184
{
185185
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -205,7 +205,7 @@ const data = {
205205
],
206206
images: [
207207
{
208-
src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
208+
id: 42
209209
},
210210
{
211211
src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -240,7 +240,7 @@ $data = [
240240
],
241241
'images' => [
242242
[
243-
'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg'
243+
'id': 42
244244
],
245245
[
246246
'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
@@ -269,7 +269,7 @@ data = {
269269
],
270270
"images": [
271271
{
272-
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
272+
"id": 42
273273
},
274274
{
275275
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
@@ -297,7 +297,7 @@ data = {
297297
],
298298
images: [
299299
{
300-
src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
300+
id: 42
301301
},
302302
{
303303
src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
@@ -393,11 +393,11 @@ woocommerce.post("products", data).parsed_response
393393
"tags": [],
394394
"images": [
395395
{
396-
"id": 792,
397-
"date_created": "2017-03-23T14:01:13",
398-
"date_created_gmt": "2017-03-23T20:01:13",
399-
"date_modified": "2017-03-23T14:01:13",
400-
"date_modified_gmt": "2017-03-23T20:01:13",
396+
"id": 42,
397+
"date_created": "2017-03-22T14:01:13",
398+
"date_created_gmt": "2017-03-22T20:01:13",
399+
"date_modified": "2017-03-22T14:01:13",
400+
"date_modified_gmt": "2017-03-22T20:01:13",
401401
"src": "https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg",
402402
"name": "",
403403
"alt": ""

0 commit comments

Comments
 (0)