修改上传文件名为:年月日时分秒+两位随机数.扩展名
打开/wp-admin/includes/file.php文件
将
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); // Move the file to the uploads dir.
替换为
$time=date("YmdH:i:s",time()+8*60*60); $file['name'] = $time."".mt_rand(1,100).".".$ext ; $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); // Move the file to the uploads dir.
保存覆盖源文件即可!