在主题的functions.php添加如下内容function rename_filename($filename) { $info = pathinfo($filename); $ext = empty($info['extension']) ? '' : '.' . $info['extension']; $name = basename($filename, $ext); return substr(md5($name), 0, 16) . $ext; //截取前面16个字符 } add_filter('sanitize_file_nam...