Opened 6 years ago
Last modified 4 years ago
#45084 new enhancement
WP_Term_Query multiple 'orderby' support
Reported by: | keraweb | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Query | Keywords: | needs-unit-tests has-patch |
Focuses: | Cc: |
Description
Just like in the regular WP_Query it would be awesome if it supported multiple orderby values (array or space separated).
I'm currently busy with a patch but the I would like some feedback and help with creating unit tests.
Examples:
<?php get_terms( 'orderby' => 'meta_value name', 'order' => 'ASC', );
<?php get_terms( 'orderby' => array( 'meta_value' => 'ASC', 'name' => 'ASC', ), );
Attachments (2)
Change History (8)
#1
@
6 years ago
- Keywords has-patch needs-docs added
I've added a patch to support this. The functionality works the same as with WP_Query (posts).
As for documentation, I'm not sure where to add this.
Same goes for unit tests, if anyone could help me with this that would be great!
#3
@
6 years ago
- Milestone changed from Awaiting Review to Future Release
Hi @keraweb,
Thanks for this! Are you able to work on adding unit tests? That would help push this along.
#4
@
6 years ago
Hi @desrosj,
No problem. And I'm not familiar with unit testing in WP core that much. I do use it for my own plugins though and I suppose the unit tests could be similar to the ones used for WP_Query itself (posts) right?
Could you point me to the right location? Also, how would I add a unit test as a patch?
Patch to support multiple orderby clauses for terms.