admin管理员组文章数量:1312850
I'm looking for a way to restrict the size of the media when uploading (a plugin or just a function).
So I found this:
function increase_upload_size_limit( $limit ) {
return 524288;
}
add_filter( 'upload_size_limit', 'increase_upload_size_limit' );
And it's working, but the thing is that i'd like to choose a different size restriction for a pdf than for a jpeg.
The thing that would really be perfect is to be able to choose the max size per format. And when uploading a media, it tries compressing it, and if the compression isn't able to compress enough (to be under the max size selected) then there's a message saying that this media can't be uploaded due to its size.
So if it just restrict upload size by format it will be good enough for me.
Thanks a lot!
本文标签: pluginsRestrict media upload size by format
版权声明:本文标题:plugins - Restrict media upload size by format 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741864390a2401814.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论