Last update at :2024-07-09,Edit by888u
In WordPress, in addition to limiting the upload file size from the settings and setting the file size from the server, you can also set the upload size individually for user groups, which is more flexible. The file size can even be set individually for each user.
Ordinary users are advised to set the image to no more than 5M, as it will take up server space if it is too large.
function corepress_filter_site_upload_size_limit($size) { if (!current_user_can('manage_options')) { //Determine whether it is an administrator. If not, set upload restrictions. There are many ways to judge $size = 1024 * 5000; } return $size; } add_filter('upload_size_limit', 'corepress_filter_site_upload_size_limit', 20);
Recommended site searches: foreign space service providers, godaddy domain name registration, Ministry of Industry and Information Technology domain name registration, Chinese international domain name, how long does it take for website registration, foreign trade hosting, website ICP registration, cloud server rental, free server permanent use, ICP registration query system, < /p>
发表评论