How to hook into plugin/theme uploader?
-
There are plenty of well-documented ways to hook into the media uploader. Are there hooks for the plugin/theme uploader, or publicly consumable ways to use parts of its functionality?
I’m interested in having the plugin/theme uploader perform some validation on the uploaded file (making sure the directory structure in the uploaded zip file doesn’t have a Git commit ID in the directory name, removing extraneous __MACOSX metadata directories, other cleanup and workflow-validation tasks…) Ideally, I’d want something that can receive the uploaded file, potentially modify it, and potentially stop the install/update process. I’ve written most of the code that I’d want to run on a given .zip file, but I’m not sure on how to have that code run at the right time as part of the upload process.
This might be niche enough that I should actually write my own upload page, actually, instead of trying to hook into the existing one. If that’s the case, I’d still prefer to use WordPress built-ins if possible. (A hundred things can go wrong when unzipping a zip file, but I bet core has already accounted for most of them.)
- The topic ‘How to hook into plugin/theme uploader?’ is closed to new replies.