Remove unnecessary error suppression from get_terms(). fixes #21887.
git-svn-id: http://core.svn.wordpress.org/trunk@23599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b35c629308
commit
4b4b35ae3b
|
@ -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 ) {
|
||||
if ( $number && is_array( $terms ) && count( $terms ) > $number )
|
||||
$terms = array_slice( $terms, $offset, $number );
|
||||
}
|
||||
|
||||
wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
|
||||
|
||||
|
|
Loading…
Reference in New Issue