把下面这段代码放到 functions.php 内即可

//上传图片重新命名
add_filter('wp_handle_upload_prefilter', function($file){
	$str = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz1234567890'),0,6); 
	$file['name'] = str_shuffle($str.time())."." .pathinfo($file['name'], PATHINFO_EXTENSION); 
	return $file; 
});