很多朋友在做wordpree主题制作的时候会经常遇到一个问题,那就是如果图片或附件是以中文命名的,就无法完成上传。关于这个问题的解决方法其实很简单,只需要在functions.php文件中插入下面的一段代码就可以了。亲测没问题的
/* 附件支持中文
/* -------------------------------- */
function wpyou_rename_upload_file_prefilter($file){
$time=date("Y-m-d");
$file['name'] = $time."".mt_rand(1,100).".".pathinfo($file['name'] , PATHINFO_EXTENSION);
return $file;
}
add_filter('wp_handle_upload_prefilter', 'wpyou_rename_upload_file_prefilter');
Related: recent deaths in montana, former eastenders actresses, wildland firefighter ppe checklist, st peregrine oil, asiana airlines covid travel requirements, , gemini and sagittarius relationship problems, murders in richmond va 1993, croton root system, walsh university baseball field, hannaford birthday cake catalog, how to read fruit roll up expiration date, homes for rent in cabarete dominican republic, what happened to jack in cider house rules, university hospital coventry pharmacy opening times,
不错,这个方法确实管用
再添加一条一级评论看看
再评论第二条一级的评论
@WordPress日记 我是回复的评论ID=7的
测试一下第一条评论怎么样!
@WordPress日记 我是测试回复最早的一条
@WordPress日记 二层回复
@WordPress日记 再测试一个看看