2:28 PM
@Mᴏɴᴋᴇʏ themes are not supposed to implement backend logic stuff
on top of that there's no reason for you to do it that way, a plugin would be just as easy if not easier, by doing it in a theme you introduce a whole new set of problems
> I'm lazy, and if I can learn a way to auto setup my environment in WP I think that be a win, lol
There's tonnes of examples, be it composer
, WP CLI, or site creation scripts such as those used in local dev setups like VVV or Chassis
the uploads folder is the uploads folder, and leave it at that
as long as it works, there's no reason to meddle in how WordPress stores things, it's just extra effort with no gain
treat it like the vendor
folder in composer, and let WP do its job
the moment you start meddling the moment problems appear
e.g. if you got your answer, the moment you switched theme your uploads folder would be a mess of 2 clashing organised systems
which wouldn't be an issue if you'd used a plugin, or an mu-plugin
file
but even then, it complicates imports and exports further
and can introduce unforeseen issues
Also looking at that question, the upload_dir
avenue is not a good avenue to take
forcing an option on can be done via filters
but changing the upload directory is like being unhappy with a sentence and instead of changing it, you go to the company that prints the dictionaries and change the meaning of the words to match what you wanted
I know you think this is ok because it's for your personal site and theme
and be honest, will you still be using the same theme in 10 years time?
what about copy pasting stuff over, and what about edge case scenarios where you might not load the theme such as some WP CLI commands? Or if the site becomes a multisite? Or you reuse your personal theme for other reasons