Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add product custom fields documentation #245

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions source/includes/wp-api-v3/_product-custom-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

The product custom fields API allows you to view the custom field names that have been recorded.

## Product custom fields properties ##
## Available parameters ##

| Attribute | Type | Description |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| `key` | string | The custom field key. |
| `value` | string | The value set for the key. |
| Parameter | Type | Description |
| --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
| `page` | integer | Current page of the collection. Default is `1`. |
| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
| `search` | string | Limit results to those matching a string. |
| `exclude` | array | Ensure result set excludes specific IDs. |
| `include` | array | Limit result set to specific ids. |
| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |

## Retrieve product custom field names ##

Expand All @@ -16,7 +21,7 @@ This API lets you retrieve filtered custom field names.
<div class="api-endpoint">
<div class="endpoint-data">
<i class="label label-get">GET</i>
<h6>/wp-json//wc/v3/products/custom-fields/names</h6>
<h6>/wp-json/wc/v3/products/custom-fields/names</h6>
</div>
</div>

Expand Down