$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Writing a plugin which needs to upload files|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Writing a plugin which needs to upload files

matteradmin8PV0评论

I am quite new to Wordpress development, and am writing a plugin which needs to have an option of uploading a spreadsheet, which the plugin will then work with and process data as appropriate.

This is for front end users, not in the admin area.

What is the best practice? Should I code an upload myself, or integrate another plugin, which my plugin calls and is dependent on? If the latter, any suggestions of a plugin????

Thank you

I am quite new to Wordpress development, and am writing a plugin which needs to have an option of uploading a spreadsheet, which the plugin will then work with and process data as appropriate.

This is for front end users, not in the admin area.

What is the best practice? Should I code an upload myself, or integrate another plugin, which my plugin calls and is dependent on? If the latter, any suggestions of a plugin????

Thank you

Share Improve this question asked Nov 8, 2018 at 17:13 StripyTigerStripyTiger 2771 silver badge6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I think this could be part of the solution you're looking for: https://codex.wordpress/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/plugins/frontend-uploader/

& here's a tutorial which looks to be along the lines of what you're describing: https://www.inkthemes/code-to-integrate-wordpress-media-uploader-in-plugintheme/

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far