我将Wordpress更新为4.7.1,无法再上传SVG了。
我的函数中有一个函数。php文件
function cc_mime_types($mimes) {
$mimes[\'svg\'] = \'image/svg+xml\';
return $mimes;
}
add_filter(\'upload_mimes\', \'cc_mime_types\');
但现在也没用了。我将Wordpress更新为4.7.1,无法再上传SVG了。
我的函数中有一个函数。php文件
function cc_mime_types($mimes) {
$mimes[\'svg\'] = \'image/svg+xml\';
return $mimes;
}
add_filter(\'upload_mimes\', \'cc_mime_types\');
但现在也没用了。根据下面的线程temporary solution 将此代码添加到wp配置文件:
define( \'ALLOW_UNFILTERED_UPLOADS\', true );
https://wordpress.org/support/topic/wp-4-7-1-kills-svg/page/3/
如果你是唯一一个有能力将文件上传到WordPress的人,那么没有。
但是如果你允许用户在你的博客上注册和发表评论,是的。。
这是一个临时修复程序,允许您上载文件。上传SVG文件后,可以随意删除代码。
在WordPress 4.9.2中,我为2017年创建了一个儿童主题。我注意到它在页面底部带有自己的SVG图标系统,用于社交媒体图标。我看到一些代码是在site-info.php 文件,在wp_nav_menu().<nav class=\"social-navigation\" role=\"navigation\" aria-label=\"<?php esc_attr_e( \'Footer Social Links Menu\', \'twentyseventeen\' ); ?>