juliemclelland
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF®)] ACF Image Fields Changing Filename of ImageYep, finally figured that out. I’m still having issues after rolling back. Going to double check that I’m on 3.17.2.
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Image upload with empty file nameWe got it to kind of work using this code (meaning it’s still wonky, but it’s showing images):
add_filter('wp_handle_upload_prefilter', 'custom_upload_filter',20 ); function custom_upload_filter( $file ) {
// Check if the file is an image.
if ( strpos( $file['type'], 'image/' ) === 0 ) {
$random_number = rand(1000, 9999); // Generate a random number between 1000 and 9999
$file['name'] = 'dw-' . $random_number . '-' . $file['name'];
}
return $file;
} add_filter( 'wp_unique_filename', 'add_dw_and_random_to_filename', 10, 4); function add_dw_and_random_to_filename($filename, $ext, $dir, $unique_filename_callback) {
$new_filename = 'dw-' . rand(1000, 9999) . '-' . $filename;
return $new_filename;
} function upload_dir_filter($uploads)
{
$day = date('d');
$uploads['path'] .= '/' . $day;
$uploads['url'] .= '/' . $day;
return $uploads;
}
add_filter('upload_dir', 'upload_dir_filter');But with this, if Pro is activated, it doesn’t work at all.
Edited to add:
- I took out the above code ^ and deactivated the pro version and it’s working fine on 3.17.2. But since I couldn’t rollback the pro version, it interferes with the 3.17.2 version.
- This reply was modified 2 years, 7 months ago by juliemclelland.
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Image upload with empty file nameI identified the pro version to be the issue by the way!
Forum: Plugins
In reply to: [Frontend Admin by DynamiApps] Image upload with empty file nameHi @shabti I’m on 3.18.2 and it’s adding a “.” as well as renaming the file completely, resulting in broken images.
I’m rolling back for now, but wanted to give you a heads up.- This reply was modified 2 years, 7 months ago by juliemclelland.
Viewing 4 replies - 1 through 4 (of 4 total)