Skip to content

Instantly share code, notes, and snippets.

@wtmujeebu
Last active October 29, 2021 11:29
Show Gist options
  • Save wtmujeebu/30d9ecc1adb538348139246a25a64289 to your computer and use it in GitHub Desktop.
Save wtmujeebu/30d9ecc1adb538348139246a25a64289 to your computer and use it in GitHub Desktop.
WooCommerce product import by WebToffee compatibility with - File Renaming on Upload plugin
<?php // Do not copy this line
add_filter('sanitize_file_name', 'sanitize_file_name_wt', 99999, 2);
function sanitize_file_name_wt($filename, $filename_raw) {
if (strpos($filename, 'temp_') !== false) {
return $filename_raw;
}
return $filename;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment