[wp-trac] [WordPress Trac] #33485: $deleted_term in wp_delete_term() has incorrect `count` value
WordPress Trac
noreply at wordpress.org
Fri Aug 21 20:05:57 UTC 2015
#33485: $deleted_term in wp_delete_term() has incorrect `count` value
----------------------------------------+-----------------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Taxonomy | Version:
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug | Focuses:
----------------------------------------+-----------------------------
Comment (by boonebgorges):
Replying to [comment:2 nicholas_io]:
> @boonebgorges, Do you mean to pass a `count` parameter to the
`delete_term_taxonomy` action? I checked the source code and I saw that
`delete_term_taxonomy` only receives the term_id.
No, I mean that the `$deleted_term` variable should be initialized before
its term relationships are deleted. That way, `$deleted_term->count` will
reflect the pre-delete state of the term. I assume that you can just
switch the blocks of code around, but this needs testing (and possibly a
unit test).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33485#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list