[wp-trac] [WordPress Trac] #41813: get_terms is hiding taxonomies that are not empty

WordPress Trac noreply at wordpress.org
Wed Sep 6 13:14:22 UTC 2017


#41813: get_terms is hiding taxonomies that are not empty
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Taxonomy          |    Version:  4.8.1
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 I have created a custom taxonomy for media type contents which has three
 terms in it. All terms have at least one image (media) associated to it.
 When I use the following code:

 {{{#!php
 <?php
 $terms = get_terms( array(
     'taxonomy' => 'media_content_category',
     'hide_empty' => true
 ));

 foreach($terms as $term) {
     echo $term->name . '<br />';
 }
 }}}


 it only displays one taxonomy when there should be all of them as no
 taxonomy is "empty".

 '''NB: All plugins are deactivated during test.'''

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41813>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list