Fix default orderby for tt_id query. see #9937

git-svn-id: http://svn.automattic.com/wordpress/trunk@11469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-27 17:09:19 +00:00
parent b32a87962a
commit d77f57c34f
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";