[wp-trac] [WordPress Trac] #41814: Custom taxonomy count shows wrong value

WordPress Trac noreply at wordpress.org
Wed Sep 6 13:32:33 UTC 2017


#41814: Custom taxonomy count shows wrong value
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Taxonomy          |    Version:  4.8.1
 Severity:  normal            |   Keywords:
  Focuses:  administration    |
------------------------------+-----------------------------
 This ticket is not an exact duplicate of #20708.

 I created a custom taxonomy called media-content-category and added three
 terms to it. Each term has at least one image attached. But `wp-admin
 /edit-tags.php?taxonomy=media_content_category` is showing wrong counts.

 However, `/wp-admin/upload.php?media_content_category=post-header-
 image&post_type=attachment` shows correct number of attachment(s) for each
 taxonomy term.

 This is how I created my custom taxonomy:

 {{{#!php
 <?php
 function emfl_media_content_taxonomy() {
     $labels = array (
         'name' => _x('Media Content Categories', 'Media Content
 Categories'),
         'singular_name' => _x('Media Content Category', 'Media Content
 Category'),
         'search_items' => __('Search Media Content Categories'),
         'all_items' => __('All Media Content Categories'),
         'parent_item' => __('Parent Media Content Category'),
         'parent_item_colon' => __('Parent Media Content Category:'),
         'edit_item' => __('Edit Media Content Category'),
         'update_item' => __('Update Media Content Category'),
         'add_new_item' => __('Add New Media Content Category'),
         'new_item_name' => __('New Media Content Category Name'),
         'menu_name' => __('Content Category')
     );

     register_taxonomy('media_content_category', array('attachment'), array
 (
         'hierarchical' => true,
         'labels' => $labels,
         'show_ui' => true,
         'show_admin_column' => true,
         'query_var' => true,
         'rewrite' => array('slug', 'content_category')
     ));
 }

 add_action('init', 'emfl_media_content_taxonomy', 0);
 }}}


 Please see screenshots.

 '''NB: No plugin is activated.'''

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


More information about the wp-trac mailing list