【发布时间】:2019-03-04 21:15:37
【问题描述】:
我在两个网站上遇到以下错误:
致命错误:未捕获的错误:函数名称必须是字符串 /home/lanesra2/public_html/wp-content/themes/Lanesra/framework/php/class-style-generator.php:123 堆栈跟踪:#0 /home/lanesra2/public_html/wp-includes/class-wp-hook.php(286):
我已经很久没有登录这些网站了,正如你所见,它们都是基于 WordPress 构建的。有什么可以解决的潜在变化吗?
这里也是代码:
{
foreach($this->rules as $rule)
{
$rule['value'] = str_replace('{{AVIA_BASE_URL}}', AVIA_BASE_URL, $rule['value']);
$rule['value'] = preg_replace('/(http|https):\/\//', '//', $rule['value']);
//check if a executing method was passed, if not simply put the string together based on the key and value array
if(isset($rule['key']) && method_exists($this, $rule['key']) && $rule['value'] != "")
{
$this->output .= $this->$rule['key']($rule)."\n";
}
else if($rule['value'] != "")
{
$this->output .= $rule['elements']."{\n".$rule['key'].":".$rule['value'].";\n}\n\n";
}
}
}
【问题讨论】:
-
听起来
$rule['key']不是字符串。可以是整数吗?当您收到此错误时,它的价值是什么?
标签: php wordpress fatal-error