Opened 2 weeks ago
Closed 2 weeks ago
#48454 closed defect (bug) (duplicate)
Term count incorrect for custom taxonomy on attachments
Reported by: | powerbuoy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.2.4 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: | ||
PR Number: |
Description
When creating a custom taxonomy for the 'attachment' post-type its term counts aren't properly updated.
To reproduce:
1) Download and install WordPress 5.2.4 with the twentynineteen theme
2) Add a custom taxonomy:
<?php add_action('init', function () { register_taxonomy('attachment_category', 'attachment', [ 'labels' => [ 'name' => 'Attachment categories', 'singular_name' => 'Attachment category' ], 'rewrite' => [ 'with_front' => false, 'slug' => 'attachment-categories', 'hierarchical' => true ], 'hierarchical' => true, 'sort' => true, 'show_in_rest' => true, 'show_admin_column' => true ]); });
3) Create some taxonomies and assign them to media:
4) Notice how term count still says zero:
Attachments (4)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Latest WordPress - clean install