Opened 14 years ago
Closed 13 years ago
#16051 closed defect (bug) (duplicate)
$taxonomy_children option is not updated after wp_insert_term
Reported by: | acsnaterse | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Taxonomy | Keywords: | has-patch reporter-feedback |
Focuses: | Cc: |
Description
When using wp_insert_term or wp_update_term the $taxonomy_children option is not set properly. This should be done in the _get_term_hierarchy
function, but I think the following line gives a problem:
if ( is_array($children) ) return $children;
It checks whether it's an array or not, but this means when the array is empty (due to manually deleting all the terms in the Admin) it also returns. And therefor it doesn't update anymore.
I think the check must be whether it's an array or not and if it is, it should also check whether the array is empty or not. So something like this:
if ( is_array($children) && !empty($children) ) return $children;
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Added statement for checking whether {$taxonomy}_children option is empty