“代码片段”片段不适用于 `big_image_size_threshold` 设置

问题描述 投票:0回答:1

我安装了 WordPress 6.5.2、“代码片段”插件 3.6.4 和以下代码片段:

add_filter( 'big_image_size_threshold', '__return_false' );

但它不起作用,WordPress仍然抱怨网站管理界面限制阈值失败2560来自

./wp-admin/includes/image.php

$threshold = (int) apply_filters( 'big_image_size_threshold', 2560, $imagesize, $file, $attachment_id );

还尝试了片段:

// Increase the image size threshold to 4096px
function mydomain_big_image_size_threshold($threshold) {
    return 4096; // new threshold
}

add_filter('big_image_size_threshold', 'mydomain_big_image_size_threshold', 999, 1);

同样的结果,错误。

尝试了页面重新加载、PHP FPM 和 Nginx 重新启动 - 仍然是同样的错误。

有人可以帮忙吗?

php wordpress code-snippets
1个回答
0
投票

已修复,问题不在 Wordpress 中,我已将

client_max_body_size 8M;
行添加到 Nginx 站点配置文件的
server
块中。

© www.soinside.com 2019 - 2024. All rights reserved.