Ticket #5372 (new defect)

Opened 1 year ago

Last modified 1 year ago

Wrong category on post insertion

Reported by: malaiac Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: General Version:
Severity: normal Keywords:
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

11/20/07 23:21:09 changed by ryan

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.