wordpress上传限制_如何仅在WordPress中将上传限制为指定的文件类型

wordpress上传限制

Few days ago while working on a client’s site, we were asked to code a function that restrict uploads to specified file types only (jpg, gif, png). After looking around the repository and finding nothing that can do this, we decided to create a plugin of our own. Yesterday, it was approved in the WordPress plugin repository and it is called Restrict Uploads.

几天前,在客户的网站上工作时,我们被要求编写一个函数,以将上传内容限制为仅指定文件类型(jpg,gif,png)。 在浏览存储库后,发现没有任何东西可以做到这一点之后,我们决定创建自己的插件。 昨天,它已在WordPress插件存储库中获得批准,称为“ 限制上传”

Unlike other plugins, this plugin does NOT have a super complex settings panel. As a matter of fact, it doesn’t have any settings panel at all. It is built to do one thing and one thing only. That is to keep your editors from uploading any other file type aside from images (jpg, gif, png). Plugins like these are the ideal type because it works silently in the background having no impact on your site’s load time, or your day to day activity.

与其他插件不同,此插件没有超级复杂的设置面板。 事实上,它根本没有任何设置面板。 它被构造为仅做一件事和一件事。 那是为了防止您的编辑者上传除图像(jpg,gif,png)之外的任何其他文件类型。 此类插件是理想的类型,因为它在后台静默运行,不会影响您的网站的加载时间或日常活动。

All you have to do is simply install and activate the plugin. Download Restrict Uploads Now.

您只需要安装并激活插件即可。 立即下载“限制上传”

翻译自: https://www.wpbeginner.com/plugins/how-to-restrict-uploads-to-specified-file-types-only-in-wordpress/

wordpress上传限制

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值