Opened 16 years ago
Closed 14 years ago
#5372 closed defect (bug) (fixed)
Wrong category on post insertion
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
in wp-includes/taxonomy.php
function = wp_set_object_terms
around lines 1013,1014
<?php
$term_ids[] = $idterm_id?;
$id = $idterm_taxonomy_id?;
?>
bug : when $id is not an array, it resets $id to 1 (i can't figure why)... and the post is assigned to the wrong (1) category, instead of the legit category.
Happens when the post category is new (has just been created)
Found when doing a custom import
Change History (2)
Note: See
TracTickets for help on using
tickets.
Current trunk adds an is_wp_error() check on $id.
http://trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php#L1141
2.3.1 lacks this check, which could explain the bad id.