WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19340 closed defect (bug) (duplicate)

unexpected result using wp_count_terms() function

Reported by: alex-ye Owned by: alex-ye
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

Hi I found a unexpected result when I testing wp_count_terms() function .

To get this error , Create a 3 categories

Catgory Name --- Posts Count


CAT 1 3
CAT 2 2
CAT 3 0


Example :
<?php echo wp_count_terms( 'catgory' , array ( 'hide_empty' => true ) ); ?>

The expected result :
2

What I get is :
3

I hope you fix the proplem .

Change History (3)

comment:1 alex-ye2 years ago

  • Owner set to alex-ye
  • Status changed from new to accepted

comment:2 alex-ye2 years ago

The categories example :

Catgory Name : CAT1 , Posts Count : 3

Catgory Name : CAT2 , Posts Count : 2

Catgory Name : CAT3 , Posts Count : 0

comment:3 SergeyBiryukov2 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.