WordPress教程

WordPress上传中文附件不显示解决方法

阿里云

WordPress 上传中文附件出现乱码和后台上传中文图片不显示解决方法,编辑 wp-admin/includes/file.php 这个文件:
1、查找:

  1. $new_file = $uploads['path'] . "/$filename";
也想出现在这里?联系我们
创客主机

替换为:

  1. $new_file = $uploads['path'] . "/" . iconv("UTF-8","GB2312",$filename);

注意,只需要替换第一处即可!
2、查找

  1. return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' );

修改为:(修正中文文件名编码问题)

  1. return apply_filters( 'wp_handle_upload', array( 'file' => $uploads['path'] . "/$filename", 'url' => $url, 'type' => $type ) , 'upload');

WordPress 上传中文附件不显示解决方法

已有 503 人购买
查看演示升级 VIP立刻购买

收藏
(1)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!