[wp-trac] Re: [WordPress Trac] #5792: delete_post doesn't appear to be called when deleting via AJAX

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 10 05:50:00 GMT 2008


#5792: delete_post doesn't appear to be called when deleting via AJAX
----------------------------+-----------------------------------------------
 Reporter:  Viper007Bond    |        Owner:  anonymous
     Type:  defect          |       Status:  new      
 Priority:  high            |    Milestone:  2.5      
Component:  Administration  |      Version:  2.5      
 Severity:  normal          |   Resolution:           
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by Viper007Bond):

  * keywords:  needs-patch =>

Comment:

 Hmm, my test plugin that I just wrote does indeed work with AJAX:
 http://pastebin.ca/898269

 However, my original hugely complex plugin does not. Here's the function
 that uses the hook:

 {{{
 function remove_uploads( $post_ID ) {
         $images = get_post_meta($post_ID, 'mig_images', TRUE);

         foreach ( (array) $images as $image ) {
                 @unlink(ABSPATH . $image['path']);
                 @unlink(ABSPATH . $image['thumbpath']);
         }

         $thumbnail = get_post_meta($post_ID, 'mig_thumbnail', TRUE);
         if ( !empty($thumbnail) ) @unlink(ABSPATH .
 get_post_meta($post_ID, 'mig_thumbnail', TRUE));
 }
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5792#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list