Opened 15 years ago
Closed 15 years ago
#15142 closed defect (bug) (worksforme)
'orderby' => 'term_order' not working in wp_get_post_categories
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.0.1 |
| Component: | Taxonomy | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
$args = array( 'fields' => 'all', 'orderby' => 'term_order', 'order' => 'DESC' ); $categories = wp_get_post_categories($post->ID, $args);
...this will not output the terms of the object ordered by the "term_order"
Change History (2)
Note: See
TracTickets for help on using
tickets.
Works fine for me on trunk.
The query generated by WordPress ->
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (1) ORDER BY tr.term_order DESC