Remove unnecessary error suppression from get_terms(). fixes #21887.

git-svn-id: https://develop.svn.wordpress.org/trunk@23599 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-03-04 02:52:43 +00:00
parent 2158fa203b
commit 1df0c7277c
1 changed files with 3 additions and 4 deletions

View File

@ -1352,7 +1352,7 @@ function get_terms($taxonomies, $args = '') {
$where .= ' AND tt.count > 0';
// don't limit the query results when we have to descend the family tree
if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) {
if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
if ( $offset )
$limits = 'LIMIT ' . $offset . ',' . $number;
else
@ -1457,9 +1457,8 @@ function get_terms($taxonomies, $args = '') {
$terms = $_terms;
}
if ( 0 < $number && intval(@count($terms)) > $number ) {
$terms = array_slice($terms, $offset, $number);
}
if ( $number && is_array( $terms ) && count( $terms ) > $number )
$terms = array_slice( $terms, $offset, $number );
wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );