#31822 closed defect (bug) (invalid)
Hierarchical custom taxonomy not showing children in admin panel
Reported by: | pinkivy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1.1 |
Component: | Taxonomy | Keywords: | |
Focuses: | administration | Cc: |
Description (last modified by )
I created a hierarchical custom taxonomy. When I am in a post, attaching these taxonomies, everything is fine. But in the admin screen for the taxonomy, I only see the top-level terms. The count at the upper-right of the listing does have the correct number of all terms, but only the very top level taxonomies show in the table. I can search for a child taxonomy and find it, and its parent is marked correctly; it just doesn't appear in the default table.
I have a _temporary fix_. I know that it is a horrible idea to edit core files, and I am not recommending that anyone do this. I am merely mentioning it because it may be helpful in getting a more proper fix into a newer release. ('academic_program_type' is the name of the taxonomy.)
In /wp-admin/edit-tags.php, before the call to $wp_list_table->display();, I added:
if ( 'academic_program_type' == $taxonomy ) { delete_option("academic_program_type_children"); wp_cache_flush(); }
Please skip the lecture on updating the core files and address the issue that the cache needs to be flushed in order to get children taxonomy items to show in the admin screen.
By the way, I also needed to flush the cache in order to traverse the taxonomy hierarchy in a custom template I created. If you're looking for related issues.
Change History (6)
#3
@
10 years ago
Thanks for the quick response.
I have tried it with the plugins deactivated, but I haven't tried with a vanilla theme yet. I will have to do that and get back to you.
#4
@
10 years ago
- Resolution set to invalid
- Status changed from new to closed
I copied the site over to a different subdomain so that I could test it more thoroughly, and I have found inconsistent behavior between the 2 sites during testing. I now think that the problem is caused by the caching mechanism of one of the plugins. My apologies. It is not a Wordpress problem.
No lecture was forthcoming. How can you identify and fix bugs in core files if you don't edit the core files?
I'm not able to reproduce this on my local installations. Can I ask for some additional info?
'get' => 'all'
param in that function should ensure that the entire tree is fetched.get_terms()
or something like that, and polluting the cache somehow.If you're able to produce the problem on a completely vanilla installation of WP (save, of course, for the code that you're using to register the custom taxonomy), please share explicit details on how to reproduce the issue. This includes your custom taxonomy code, as well as whatever steps you're performing (presumably, creating some terms, publishing posts?, visiting edit-tags.php, all in some specific order). Thanks.