[wp-trac] [WordPress Trac] #35462: update_term_cache and deleting object_id

WordPress Trac noreply at wordpress.org
Fri Jan 15 19:23:51 UTC 2016


#35462: update_term_cache and deleting object_id
--------------------------+--------------------
 Reporter:  berengerzyla  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.4.2
Component:  Taxonomy      |     Version:  4.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by boonebgorges):

 @berengerzyla Thanks for the pointer to Anything Order. It turns out
 they're doing exactly what I hypothesized:

 * First, they filter `wp_get_object_terms`:
 https://plugins.trac.wordpress.org/browser/anything-
 order/tags/1.0.3/modules/taxonomy/class.php?marks=30#L17
 * Then, in the filter callback, they query the database for terms -
 including `object_id` - and then send them through `update_term_cache()`
 before returning them. https://plugins.trac.wordpress.org/browser
 /anything-order/tags/1.0.3/modules/taxonomy/class.php?marks=229#L217

 In this way, they cause term objects to be `object_id`-free by the time
 they come out of `wp_get_object_terms()`.

 Switching to `clone` ought to fix this. Thanks again for the ticket!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35462#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list