Which filters or actions to use after a media upload and delete?

i guess you are looking for this

add_attachment

and

delete_attachment

example:

add_action('add_attachment', 'attachment_manipulation');
function attachment_manipulation($id)
{
  if(wp_attachment_is_image($id)){
    //do your own tasks
  }

}

Leave a Comment