-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Query Loop: Add 'menu_order' as sorting option #68781
Changes from all commits
3b58ff3
da4bda6
4485aaa
e1df800
ab8e64c
415d628
033fbb8
1574bed
ec4b822
328bd7c
bc1d68b
7823620
7d9ea7c
4a1c5e6
3fb27ec
749d3b6
184dba9
bf24a8b
fdf0915
9e36a1e
48ede3a
a40f1ad
02a8ecb
b3533c1
b1bf9bd
e40c9b3
233b9d8
59c632d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ const QUERY_DEFAULTS = { | |
|
||
const MyQueryControls = () => { | ||
const [ query, setQuery ] = useState( QUERY_DEFAULTS ); | ||
const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query; | ||
const { category, categories, maxItems, minItems, numberOfItems, order, orderBy } = query; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Mamaduka I got confused by the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new options are included now in We should also update the |
||
|
||
const updateQuery = ( newQuery ) => { | ||
setQuery( { ...query, ...newQuery } ); | ||
|
@@ -213,7 +213,14 @@ The order in which to retrieve posts. | |
- Required: No | ||
- Platform: Web | ||
|
||
#### `orderBy`: `'date' | 'title'` | ||
#### `orderBy`: `'date' | 'title' | 'menu_order'` | ||
|
||
The meta key by which to order posts. | ||
|
||
- Required: No | ||
- Platform: Web | ||
|
||
#### `orderByOptions`: `OrderByOption[]` | ||
|
||
The meta key by which to order posts. | ||
|
||
|
@@ -246,4 +253,4 @@ The selected category for the `categoriesList` prop. | |
Start opting into the larger default height that will become the default size in a future version. | ||
|
||
- Required: No | ||
- Default: `false` | ||
- Default: `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're keeping the defaults as fallback to prevent breaking changes.