mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
Don't order term count queries.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4138294f52
commit
98b2e56753
@ -819,11 +819,18 @@ function &get_terms($taxonomies, $args = '') {
|
||||
$orderby = 't.slug';
|
||||
else if ( 'term_group' == $_orderby )
|
||||
$orderby = 't.term_group';
|
||||
else if ( 'none' == $_orderby )
|
||||
$orderby = '';
|
||||
elseif ( empty($_orderby) || 'id' == $_orderby )
|
||||
$orderby = 't.term_id';
|
||||
|
||||
$orderby = apply_filters( 'get_terms_orderby', $orderby, $args );
|
||||
|
||||
if ( !empty($orderby) )
|
||||
$orderby = "ORDER BY $orderby";
|
||||
else
|
||||
$order = '';
|
||||
|
||||
$where = '';
|
||||
$inclusions = '';
|
||||
if ( !empty($include) ) {
|
||||
@ -916,11 +923,13 @@ function &get_terms($taxonomies, $args = '') {
|
||||
$selects = array('t.term_id', 'tt.parent', 'tt.count', 't.name');
|
||||
break;
|
||||
case 'count':
|
||||
$orderby = '';
|
||||
$order = '';
|
||||
$selects = array('COUNT(*)');
|
||||
}
|
||||
$select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args ));
|
||||
|
||||
$query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit";
|
||||
$query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where $orderby $order $limit";
|
||||
|
||||
if ( 'count' == $fields ) {
|
||||
$term_count = $wpdb->get_var($query);
|
||||
|
Loading…
Reference in New Issue
Block a user