Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15142 closed defect (bug) (worksforme)

'orderby' => 'term_order' not working in wp_get_post_categories

Reported by: johnnypea's profile johnnypea 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)

#1 @Utkarsh
14 years ago

  • Cc admin@… added
  • Keywords reporter-feedback added; taxonomy orderby categories removed

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

#2 @nacin
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.