Can’t update plugins in WordPress, system returns -1

It seems that several template plugins are causing these kind of issues (Astra Starter templates, Smart Templates, etc.) If you have one of these installed, try to deactivate them and then update all the plugins, including the template ones. Once updated, you can safely re-active such plugins. Hope it helps.

Media library upload hook

I think what you need is media_upload_{$type} hook. Here’s the documentation for it: https://developer.wordpress.org/reference/hooks/media_upload_type/ There’s also an easier way to achieve a similar result, by using the filter wp_handle_upload which is really straightforward. Here’s the doc about it: https://developer.wordpress.org/reference/hooks/wp_handle_upload/ If you could provide more details about the result you want to achieve, I’ll try my … Read more