admin管理员组文章数量:1415100
According to the Codex, all that's needed to enable the unfiltered_ upload
capability - i.e. the ability to upload any filetypes to the Media Library rather than just the default whitelisted ones - is to set:
define( 'ALLOW_UNFILTERED_UPLOADS', true );
...in wp-config, which I have done and placed above the line where it says to stop editing.
Most online articles about enabling the capability suggest it's sufficient to stop here, including an answer on this very site, but the Codex itself suggests that it's necessary to actively assign the capability to users, which I've also done, in my theme's functions.php
file:
$edit_admin = get_role('administrator');
$edit_admin->add_cap('unfiltered_upload');
However, despite this, whenever going to my Media Library to upload a non-supported file (so far tested with an .AI file and .SVG file), I still get the standard error:
Sorry, this file type is not permitted for security reasons.
Why is this?
本文标签: wp adminWhy is unfilteredupload not working despite being enabled
版权声明:本文标题:wp admin - Why is unfiltered_upload not working despite being enabled? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745230577a2648804.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论