WordPress.org

Make WordPress Core

Changeset 23599


Ignore:
Timestamp:
03/04/2013 02:52:43 AM (7 years ago)
Author:
SergeyBiryukov
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r23598 r23599  
    13531353
    13541354    // don't limit the query results when we have to descend the family tree
    1355     if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) {
     1355    if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
    13561356        if ( $offset )
    13571357            $limits = 'LIMIT ' . $offset . ',' . $number;
     
    14581458    }
    14591459
    1460     if ( 0 < $number && intval(@count($terms)) > $number ) {
    1461         $terms = array_slice($terms, $offset, $number);
    1462     }
     1460    if ( $number && is_array( $terms ) && count( $terms ) > $number )
     1461        $terms = array_slice( $terms, $offset, $number );
    14631462
    14641463    wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
Note: See TracChangeset for help on using the changeset viewer.