[wp-trac] [WordPress Trac] #8909: Make delete_attachment action hook helpful

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 21 19:11:40 GMT 2009


#8909: Make delete_attachment action hook helpful
--------------------------+-------------------------------------------------
 Reporter:  filosofo      |       Owner:  anonymous                  
     Type:  defect (bug)  |      Status:  new                        
 Priority:  normal        |   Milestone:  2.8                        
Component:  General       |     Version:  2.8                        
 Severity:  normal        |    Keywords:  delete_attachment has-patch
--------------------------+-------------------------------------------------
 Similar to the situation with [ticket:2956 delete_user], the
 {{{delete_attachment}}} action hook fires off too late to be of much use:
 at that point the attachment and all of its data have been deleted.

 People have complained about this [http://comox.textdrive.com/pipermail
 /wp-hackers/2009-January/023846.html here] and
 [http://wordpress.org/support/topic/226773 here].

 I grepped through the plugin repository, and of about 6200 plugins, only 5
 use the delete_attachment hook: audit-trail, karailievs-sitemap,
 lumberjack, power-thumbnail, vivtiger-image-resizer.  (One other one---
 scissors---complains in a comment about the fact that the hook can't be
 used at that point).

 Of those plugins that use delete_attachment, it appears that none would be
 adversely affected by my patch.  In fact, at least one (vivtiger-image-
 resizer) has a conditional block based on getting back post information
 from the id passed to the callback, something that currently cannot
 happen, so my patch should apparently keep it from having orphaned
 thumbnails.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8909>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list