Folder name with upload_dir Organize uploads by year, month and day
-
I found this code in the furum, I modified it slightly to add the hours and minutes. That’s exactly what I want. The problem is: on the server, folders automatically create each minute even if nothing is uploaded. My question is what is the code to stop the automatic creation of empty folders or what code is creating folder only when there is an upload?
function upload_dir_filter($uploads){ $day = date('d'); $hour = date('H'); $minute = date('i'); $uploads['path'] .= '/' . $day . '/' . $hour . '/' . $minute; $uploads['url'] .= '/' . $day . '/' . $hour . '/' . $minute; return $uploads; } add_filter('upload_dir', 'upload_dir_filter');The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Folder name with upload_dir Organize uploads by year, month and day’ is closed to new replies.