#39895 closed defect (bug) (invalid)
wp_set_object_terms tries to treat object as string
Reported by: | dracos | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.2 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
If I've understood this correctly, in wp_set_object_terms, $old_tt_ids is set to a call to wp_get_object_terms(), which returns an array of objects. It then runs array_diff on this with $tt_ids, putting the difference in $delete_tt_ids, and if there is anything different, it calls implode( "', '", $delete_tt_ids ) – which dies because it tries to treat the objects inside of $delete_tt_ids as strings, with the error:
"Object of class stdClass could not be converted to string in .../wp-includes/taxonomy.php"
When I am seeing the error, in a third party plugin, $tt_ids is empty, $old_tt_ids is an array of one stdClass Object ( [term_id] => 8, [name] => posttag, [slug] => posttag, [term_group] => 0, [term_taxonomy_id] => 8, [taxonomy] => post_tag, [description] => , [parent] => 0, [count] => 10 ) and so the error occurs.
Apologies if I've misunderstood something.
Looks like it must be another plugin interfering with get_terms, sorry for the noise.