Skip to content

Commit 85469c3

Browse files
Update orderby_meta_key example
1 parent a23d519 commit 85469c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: source/includes/v2/_introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Note that the following filters are supported for all endpoints except the `repo
178178
| `q` | performs a keyword search and returns resources that match, e.g. `GET /products?filter[q]=search-keyword`. Note that search terms should be URL-encoded as they will be decoded internally with [`urldecode`](http://us3.php.net/manual/en/function.urldecode.php) |
179179
| `order` | controls the ordering of the resources returned, accepted values are `ASC` (default) or `DESC` |
180180
| `orderby` | controls the field that is used for ordering the resources returned. Accepts the same arguments as [`WP_Query`](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters). Defaults to `date`. You can order by `meta_value` but you must provide `orderby_meta_key` |
181-
| `orderby_meta_key` | the meta key to order returned resources by when using `orderby=meta_value`. For example, you could order products by price using `GET /products?filter[orderby]=meta_value&filter[orderby_meta_key]=_price` |
181+
| `orderby_meta_key` | the meta key to order returned resources by when using `orderby=meta_value`. For example, you could order products by price using `GET /products?filter[orderby]=meta_value_num&filter[orderby_meta_key]=_price` |
182182
| `post_status` | limits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. `GET /products?filter[post_status]=draft` |
183183
| `meta` | resource meta is excluded by default, but it can be included by setting `meta=true`, e.g. `GET /orders?filter[meta]=true`. Protected meta (meta whose key is prefixed with an underscore) is not included in the response |
184184
| `pagination` | explained below |

Diff for: source/includes/v3/_introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Note that the following filters are supported for all endpoints except the `repo
174174
| `q` | performs a keyword search and returns resources that match, e.g. `GET /products?filter[q]=search-keyword`. Note that search terms should be URL-encoded as they will be decoded internally with [`urldecode`](http://us3.php.net/manual/en/function.urldecode.php) |
175175
| `order` | controls the ordering of the resources returned, accepted values are `ASC` (default) or `DESC` |
176176
| `orderby` | controls the field that is used for ordering the resources returned. Accepts the same arguments as [`WP_Query`](http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters). Defaults to `date`. You can order by `meta_value` but you must provide `orderby_meta_key` |
177-
| `orderby_meta_key` | the meta key to order returned resources by when using `orderby=meta_value`. For example, you could order products by price using `GET /products?filter[orderby]=meta_value&filter[orderby_meta_key]=_price` |
177+
| `orderby_meta_key` | the meta key to order returned resources by when using `orderby=meta_value`. For example, you could order products by price using `GET /products?filter[orderby]=meta_value_num&filter[orderby_meta_key]=_price` |
178178
| `post_status` | limits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. `GET /products?filter[post_status]=draft` |
179179
| `meta` | resource meta is excluded by default, but it can be included by setting `meta=true`, e.g. `GET /orders?filter[meta]=true`. Protected meta (meta whose key is prefixed with an underscore) is not included in the response |
180180
| `pagination` | explained below |

0 commit comments

Comments
 (0)