WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/21/2013 04:47:43 PM (8 years ago)
Author:
wonderboymusic
Message:

Ensure that terms with a post count of 0 are not returned in wp_count_terms() when hide_empty => true. Adds unit test which ensures that wp_count_terms() returns 0.

Props markjaquith.
Fixes #15919.

File:
1 edited

Legend:

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

    r25498 r25551  
    13701370    }
    13711371
     1372    if ( 'count' == $fields )
     1373        $hierarchical = false;
     1374
    13721375    if ( $hide_empty && !$hierarchical )
    13731376        $where .= ' AND tt.count > 0';
Note: See TracChangeset for help on using the changeset viewer.