[wp-trac] [WordPress Trac] #31822: Hierarchical custom taxonomy not showing children in admin panel

WordPress Trac noreply at wordpress.org
Tue Mar 31 19:38:05 UTC 2015


#31822: Hierarchical custom taxonomy not showing children in admin panel
--------------------------+------------------------------
 Reporter:  pinkivy       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  4.1.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  administration
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * focuses:   => administration


Old description:

> 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.

New description:

 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.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31822#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list