[wp-trac] [WordPress Trac] #13731: delete_post action called twice in wp_delete_post
WordPress Trac
wp-trac at lists.automattic.com
Sat Jun 5 05:18:24 UTC 2010
#13731: delete_post action called twice in wp_delete_post
--------------------------+-------------------------------------------------
Reporter: mdawaffe | Owner:
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 3.0
Component: General | Version: 3.0
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
Comment(by mdawaffe):
Replying to [comment:3 nacin]:
> And running this filter twice actually has been double-logging something
on one of my sites and I just never realized it.
That's how I found it.
I think anyone relying on this double call went into it asking for
trouble.
That said, I'm not convinced there's an easy fix this late in the 3.0
process.
If we get rid of the second call in wp_delete_post(), that leaves an
inconsistent call to delete_post in wp_delete_attachment.
If we delete the first call in wp_delete_post(), we lose the ability to
look at comments, postmeta, children, etc.
Either way, that's a significant API change. Maybe the most robust fix
would be to just rename the first call: pre_delete_post ore something.
delete_post would then act the same in both wp_delete_post() and
wp_delete_attachment().
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13731#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list