There are cases in which a plugin or theme needs to create a php file somewhere that can later include it. For example a captcha plugin, or some kind of a templating system like twig/smarty (In my situation it’s simple template engine for a collection of widgets).

Where should be this file created?

The only place I can think of is wp-content/uploads/, but that just doesn’t sound right 🙂

So is there a safe place where you can create files, and not worry about them being deleted on WordPress/plugin/theme update ?

One solution could be to create a child theme / directory in the themes / plugins directory…

6

The appropriate place IMHO would be a custom folder that you create inside the wp-content directory Read this before creating files: http://ottopress.com/2011/tutorial-using-the-wp_filesystem/

Leave a Reply

Your email address will not be published. Required fields are marked *