Bug: CDN S3 Sync
-
We have many such filters as follows that classify files into their own unique directories based on filename patterns.
add_filter('wp_handle_upload_prefilter', 'icons_upload_filter' ); function icons_upload_filter( $file ){ $is_icon = stripos($file['name'], 'icon-'); if( $is_icon !== false ){ add_filter('upload_dir', 'icons_post_upload_dir'); } return $file; } function icons_post_upload_dir($path){ $custom_dir = '/icons'; $path['path'] = str_replace($path['subdir'], '', $path['path']); //remove default subdir (year/month) $path['url'] = str_replace($path['subdir'], '', $path['url']); $path['subdir'] = $custom_dir; $path['path'] .= $custom_dir; $path['url'] .= $custom_dir; return $path; }The issue is that when W3TC tries to sync files to S3 it uses the wrong path and we end up seeing the following error.
wp-content/uploads/icon-ad1.png Source file not found.But when I check the path of the file in wp_posts or wp_postmeta we see the corrent URL.
Screenshots:Is there a filter in W3TC we can use to correct the path while uploading to S3?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Bug: CDN S3 Sync’ is closed to new replies.