Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#37909 closed defect (bug) (worksforme)

get_terms returns array with missing cells

Reported by: eddr Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Taxonomy Keywords: reporter-feedback
Focuses: Cc:


This call
get_terms( 'settings-set', array('hide_empty' => true) );

returns and array with cells 0,1,3,4,5,6 set (cell 2 is missing)
There are total of 7 terms and one is empty, so the returned terms of a complete set, but the array is broken

Change History (2)

#1 @boonebgorges
5 years ago

  • Keywords reporter-feedback added

@eddr Thanks for the ticket, and welcome to WordPress Trac!

I can't reproduce this issue. Even when hide_empty is true, array indexes should be consecutive with a default query.

Are you running any plugins that may be filtering 'get_terms' or some other part of the term query process? Are you using a persistent object cache like Memcached? Are you able to reproduce the issue on a clean installation of WordPress, with no plugins (other than the one you use to register the taxonomy)?

#2 @desrosj
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Going to close this out due to lack of reporter feedback. @eddr if you are still experiencing this issue, please reopen with more details to reproduce.

Note: See TracTickets for help on using tickets.