I was wondering what you thought about adding a filter somewhere that lets us modify while file types can be replaced using your plugin.
For example, I want to let our users replace text / word / pdf files, but not any kind of images or anything. I don’t think it would be too much work, really.
wp_check_filetype_and_ext already accepts an optional array of allowed types, so maybe something like:
$allowed_types = apply_filters(’emr_replacable_mime_types’, get_allowed_mime_types());
Then pass that in as the 3rd parameter to wp_check_filetypes_and_ext.
To take it one step further, I think you’d just want to do a similar check on the attachment page to help you decide if you even show the Replace link or not.
- The topic ‘Feature Request: Limit what types can be replaced’ is closed to new replies.