【问题标题】:I cannot upload images in Wordpress library我无法在 Wordpress 库中上传图片
【发布时间】:2016-12-06 14:26:50
【问题描述】:

我无法在 Wordpress 库中上传图片。 WP 返回 http 错误。在 htaccess 和 php.ini 中,所有限制都设置为 1024 mb

Wordpress 调试模式返回:

注意:使用未定义的常量“wp_image_editors” - 假定 ''wp_image_editors'' 在 /xxx/public_html/wp-includes/functions.php 上 第 5467 行

注意:使用未定义的常量“change_graphic_lib” - 假设 /xxx/public_html/wp-includes/functions.php 中的“change_graphic_lib” 第 5467 行

我能做什么?

编辑:第 5467 行 function.php

add_filter( ‘wp_image_editors’, ‘change_graphic_lib’ );

function change_graphic_lib($array) {
return array( ‘WP_Image_Editor_GD’, ‘WP_Image_Editor_Imagick’ );
}

【问题讨论】:

  • 你能把你的functions.php文件第5467行贴出来
  • 我编辑了帖子。给你
  • 看起来您在代码中插入了奇怪的引号。确保您使用的是'"

标签: php wordpress


【解决方案1】:

您使用了错误的引号。

试试:

add_filter('wp_image_editors', 'change_graphic_lib');

function change_graphic_lib($array) {
return array('WP_Image_Editor_GD', 'WP_Image_Editor_Imagick');
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-15
    • 2022-11-04
    • 2023-03-16
    • 2018-09-15
    • 2014-01-23
    • 2014-01-16
    • 2013-02-16
    • 1970-01-01
    相关资源
    最近更新 更多