Writing a plugin which needs to upload files

I think this could be part of the solution you’re looking for: https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_handle_upload_prefilter How familiar are you with web-forms in php & file-uploads in general? Here’s a prebuilt plugin solution for frontend uploads: https://wordpress.org/plugins/frontend-uploader/ & here’s a tutorial which looks to be along the lines of what you’re describing: https://www.inkthemes.com/code-to-integrate-wordpress-media-uploader-in-plugintheme/

Call PHP file within a plugin to activate function

Here’s an approach that would be more portable (so you don’t have to call wp-load.php directly, which is something you want to avoid) and also would allow you to revise the URL to not point to the /wp-content/plugins/ directory (also something you want to avoid): add_action( ‘init’, ‘my_pdf_generator’ ); function my_pdf_generator() { // sniff out … Read more