Opened 11 years ago
Closed 11 years ago
#33483 closed defect (bug) (invalid)
Logic error in wp_delete_term
| Reported by: | ipm-frommen | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Yesterday I was debugging some stuff related to term deletion. That's when I saw this:
if ( isset( $args['default'] ) ) {
$default = (int) $args['default'];
if ( ! term_exists( $default, $taxonomy ) ) {
unset( $default );
}
}
In effect, this does something like unset( 1 ); (in case the term with ID 1 is the default term). I suppose, this should be unset( $args['default'] );, right?
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
$argsis never used later in the function. However, there are severalisset( $default)checks. So unsetting$defaultin case a term doesn't exist makes sense.