Plugin Author
Rinat
(@rinatkhaziev)
Can you post the steps to reproduce and also more details about your setup (wp version, hosting, etc)
Thread Starter
edpgm
(@edpgm)
WordPress 3.5.1 being hosted on Bluehost. The directories 2013/01 02 03 have all been created, but anything I upload in the last couple of days with the Frontend Uploader goes into 2012/12 (wp-content/uploads/) I was wondering if anyone else had encountered this problem. I don’t seem to be having a date issue with any other aspect of the site. The plugin was installed from within WP.
Thread Starter
edpgm
(@edpgm)
Just upgraded to version .4 of the plugin. Same thing, upload through the plugin, the photo goes into 2012/12, upload through media library, photo goes into 2013/03.
Thread Starter
edpgm
(@edpgm)
Further to the above, I am using the current version of the Suffusion WP theme and the photos continue to go into 2012/12. Also, I discovered that whatever is entered into the author field is overridden by the user’s logon id and whatever is entered into the credit field does not seem to be carried over to any field at all.
Plugin Author
Rinat
(@rinatkhaziev)
Hey can you try to disable the plugin and see if media still goes to the wrong folder?
Thread Starter
edpgm
(@edpgm)
If I don’t use the uploader, if I just use the Media library uploader, all uploads go into the correct 2013/03 folder.
Thread Starter
edpgm
(@edpgm)
On a different wp site on the same server, using a different theme, I am contributing photos on 2013/04/02 but the photos are ending up in 2013/03
Plugin Author
Rinat
(@rinatkhaziev)
Hey,
Thanks. I was able to track it down. Apparently it’s an issue that was introduced with WP 3.5. I tracked it down to an underlying WP core API methods. I will fix it soon-ish π
Plugin Author
Rinat
(@rinatkhaziev)
Ok, so I investigated a bit further. It appears to be that WordPress’ core upload functions set upload folder based on a post that it’s attached to.
E.g.: You’ve created your post that holds Frontend Uploader shortcode in Dec 2012. Hence all the attachments get uploaded to 2012/12.
There’s a workaround for it, but it’s kinda obtrusive and might lead to unexpected consequences. If it’s really important for you, here’s a snippet that’ll take care of your issue.
add_filter( 'upload_dir', 'my_filter_upload_dir' );
function my_filter_upload_dir( $upload_dir ) {
// Keep the original year/month
$old_subdir = $upload_dir['subdir'];
// Generate the yearly and monthly dirs
$time = current_time( 'mysql' );
$y = substr( $time, 0, 4 );
$m = substr( $time, 5, 2 );
$new_subdir = "/$y/$m";
// Replace the old year and month to the current ones on upload
foreach( $upload_dir as $index => $dir ) {
if ( !is_bool( $dir ) )
$upload_dir[$index] = str_replace( $old_subdir, $new_subdir, $dir );
}
return $upload_dir;
}
Thread Starter
edpgm
(@edpgm)
Thanks so much for tracking this down. As long as I understand what’s happening I can work with it. Great support!
Also, any way to drop the credit field, since information entered there does not seem to go anywhere?
Plugin Author
Rinat
(@rinatkhaziev)
Regarding the credit, it’s a known issue, there’s no way to remove the field currently. The underlying issue is the top priority for the next version.
Marking as resolved since original question was resolved