As of now my uploaded files are organized by year and month. But I would like to organize them by year, month and day. I mean like this 2012/10/30/image goes here
PS: There is a plugin available to do this. But I don’t want to use a plugin for this simple task. Thanks
Code based in other Answer of mine and this SO Answer.
It uses the post/page/cpt publish date to build the paths.
Note that
$the_post->post_date_gmt
is also available.As far as I can tell, the filter ‘upload_dir’ is only called once in wp-includesfunctions.php
I find this solution to be much simpler. It will place all uploads into the year/month/day directory for the date it is uploaded.
I have made a new code out of these 2 code. The images will be uploaded to the post date folder not the uploaded date folder: