you might consider using
if(get_post_mime_type($id) == 'application/pdf'){
...
}
to check for pdf files.
http://codex.wordpress.org/Function_Reference/get_post_mime_type
You might also take a look at the code behind the wp_delete_attachment() function and you can hook into it with the delete attachment action. To remove the files you can use unlink()
Related Posts:
- Can upload doc and pdf but not ppt – not permitted for security reasons
- How to stop unlink images when remove a site or user
- How To Add Custom Form Fields To The User Profile Page?
- Get upload URL by blog ID in multisite
- How to delete post revisions?
- Add additional Network constants to wp-config.php dynamically
- Multisite stuck at 1MB for max file size
- Which asset URLs are acceptable in a “vanilla” MU install?
- Anyone figured out how to use WordPress MultiSite with Domain Mapping & SSL?
- What is the best way to load the WP environment in a subdomain of my multisite WordPress install?
- Best way to develop multisite and deploy on another server?
- Upload path/URL weirdness for the main blog of a multisite/network setup
- How To Provide Sub-Blogs Their Own Domain Names?
- Turn off ms-files.php after network setup
- Organize uploaded media files
- How to upload images manually to wordpress?
- Removing My Sites menu from Admin
- Sharding BLOGUPLOADDIR
- Prevent Deletion of Blogs
- Advanced Custom Fields Multisite Upload/Imagery Issue [closed]
- How to make WordPress use new Upload Path settings in Multisite Setup
- NGINX Multisite Rewrite rules
- How to Set up a Multisite WordPress?
- Hook filter to change wp_upload_dir() path in multisite
- Multisite, turn off “create new site”
- Uploading Images to Multi-Site Causes Failure to HTTP Error
- Shared upload folder in wordpress multisite
- What are the differences in capabilities between the super-administrator and administrator?
- .epub file blocked despite ALLOW_UNFILTERED_UPLOADS set to true
- How to get max upload size and accepted file types on multisite?
- Network setup tab is not shown under Tools
- How To Modify New Sub Blog Immediately When Super Administrator Creates It?
- How do I add JavaScript that will execute on all my sites in Multisite?
- Force Uploads Use Yearmonth to off (0) for all existing sites in Multisites
- why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?
- Subdomain and subdirectories together in one installation
- Images uploading to wrong directory after changing to multisite
- Limit multisite/network site names to a property of the user
- How do I maintain static directories on multisite subdomains?
- Why are images not displaying?
- Replacing the default content created while the site creation
- WP Multisite Static Frontpage
- Preview posts returns 404
- Multisite on Rackspace Cloud (ubuntu lucid)
- Media library not loading after switching the main site of multisite
- What should I do? A multisite, a single website or many websites? [closed]
- Multisite media library uploads broken images
- Multiple homes for multiple languages [closed]
- WordPress multisite installation broke menu links
- Hosting a seperate wordpress project on localhost
- Multisite development environment
- Upload images from one site to another in Multisite
- Pushing stored procedure to a multisite database in WordPress
- Where does multisite store image uploads?
- Error uploading files bigger than 58 MB
- WP doesn’t remove uploads from folder when removed from “Media Library”?
- How does WordPress determine which multisite the user is on from the URL?
- Multisite multidomain
- ‘Cheatin’ uh?’ Error When Attempting to Upload Images After 3.4 Update
- How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
- How to recover deleted site in WordPress Multisite?
- WordPress Multisite domain mapping with different IPs
- Multisite – Images often getting uploaded to the wrong month directory
- Merge Multisites with Shared Network Media Library
- Copying media from multisite subsites to main website
- Show media-frame-menu on custom Media Frame
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- Multisite sub-directories IIS 7.5 change media/uploads location
- How can I add custom meta on signup page and pass along to be used after blog activation?
- Migrating static site to multisite with multiple domains and subdomains
- Redirect to another page using contact form 7? [closed]
- muliple wordpress multisite installs on the same sever
- Save uploads directly in the uploads folder (on a multisite)
- Replicate network plugins without having to configure it for each subsite?
- Different Domains in Multisite Setup
- Multisite adjust uploads like (/upload/%alphanumeric_id%/%file_type%/%blog_ID%)
- How to publish some default pages in Multisite creation?
- Can I use the same Folder name as a Multisite Blog?
- How long is “as long as possible” in wp_cache_set()?
- more tables created when create a new site
- Multisite missing tmp folder error while uploading
- Pros and Cons of Post Types vs. Multiple Blogs
- Multisite subdomain-site redirects to primary site
- Multisite subdirecty added inside URL to uploaded files
- How To Upload Existing WordPress Site To WordPress Multisite Using SSH
- Remove multisite part from wordpress multisite upload directory
- How to set upload path after renaming uploads folder in Multisite?
- WordPress Multisite subdomains and sharing the same upload folder
- Delete all blogs on multisite
- New wordpress uploads are broken
- Primary site file uploads failing, subdirectory subsites upload fine
- Is there a way to add a function that will get run after a blog is created?
- Pointing multiple subdomains at the same WordPress Installation
- Set static page as default front page on newly created sites in multisite
- Using common slider in all sites
- Multi site and media uploader
- WordPress Multisite platform for different city for single db
- MP4 upload ok, but HTTP500 if I update the file (multisite)
- Integrating WordPress for blog and other content pages in a web app
- WordPress Multisite