[wp-trac] [WordPress Trac] #18044: `delete_post` hook has off-by-1 error in `$postid` parameter

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 9 06:06:26 UTC 2011


#18044: `delete_post` hook has off-by-1 error in `$postid` parameter
--------------------------+------------------------------
 Reporter:  meitar        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Plugins       |     Version:  3.2
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+------------------------------
Changes (by kawauso):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 The ID being passed to the filter is a post revision, the $_GET value is
 the parent post ID. In my test these were 849 and 838 respectively, so
 being off by one is coincidence.

 'delete_post' is actually invoked for each revision before the parent
 post, so if you remove the exit from your test code, you should see they
 match in the final iteration.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18044#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list