I am creating a CSS generator in my WordPress theme and I want to be able to save custom skins with images as well. My problem is that I have a hierarchy like /skins/custom-skin/images for the uploaded images, but as you know the WordPress Media Uploader puts them in the uploads folder by default, sorted by date.
My question is, can I specify a path to save the image to every time a new image is uploaded?
In,
You can uncheck the,
Organize my uploads into month- and year-based folders
…and optionally change the path uploads (but this would effect all uploads of course).
Optionally you can hook onto the
upload_dir
filter and change the upload path for a givenpost_type
, or for some other given scenario depending upon where and under what condition you are making these uploads.That should work, though I’ve not tested it, so I’m going off the top my head at the moment.