Use AND instead of HAVING. #2604
git-svn-id: http://svn.automattic.com/wordpress/trunk@4039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1fe8d71aa1
commit
8f699d20f7
|
@ -70,9 +70,9 @@ function &get_categories($args = '') {
|
||||||
$having = '';
|
$having = '';
|
||||||
if ( $hide_empty ) {
|
if ( $hide_empty ) {
|
||||||
if ( 'link' == $type )
|
if ( 'link' == $type )
|
||||||
$having = 'HAVING link_count > 0';
|
$where .= ' AND link_count > 0';
|
||||||
else
|
else
|
||||||
$having = 'HAVING category_count > 0';
|
$where .= ' AND category_count > 0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !empty($number) )
|
if ( !empty($number) )
|
||||||
|
@ -80,7 +80,7 @@ function &get_categories($args = '') {
|
||||||
else
|
else
|
||||||
$number = '';
|
$number = '';
|
||||||
|
|
||||||
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where $having ORDER BY $orderby $order $number");
|
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE $where ORDER BY $orderby $order $number");
|
||||||
|
|
||||||
if ( empty($categories) )
|
if ( empty($categories) )
|
||||||
return array();
|
return array();
|
||||||
|
|
Loading…
Reference in New Issue