Fix default orderby for tt_id query. see #9937

git-svn-id: https://develop.svn.wordpress.org/trunk@11469 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-27 17:09:19 +00:00
parent e38c2c7c07
commit 813973d04f
1 changed files with 5 additions and 4 deletions

View File

@ -1250,12 +1250,13 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
$orderby = '';
$order = '';
} else {
if ( 'tt_ids' == $fields )
$orderby = 'tr.term_taxonomy_id';
else
$orderby = 't.term_id';
$orderby = 't.term_id';
}
// tt_ids queries can only be none or tr.term_taxonomy_id
if ( ('tt_ids' == $fields) && !empty($orderby) )
$orderby = 'tr.term_taxonomy_id';
if ( !empty($orderby) )
$orderby = "ORDER BY $orderby";