标题下方所有页面上的Wordpress中的错误使用主题elumine

问题描述

该错误位于下面的所寻址文件的下面几行(第186和187行):

网站(实时):www.healthyminds.world

尝试还原较早的备份(24小时后),但这也不起作用。

源行中的186和187行:

CharResponseWrapper responseWrapper = new CharResponseWrapper((HttpServletResponse) response);

错误消息(在网站的所有页面上,这些只是其中的几行):

$collections = get_option('google_typography_collections');
$google_fonts_all = $this->get_fonts();
$import_fonts = array();
if ($collections) {
    foreach ($collections as $collection) {
        $font_family = $collection['font_family'];
        $font_index = array_search($font_family,array_column($google_fonts_all,'family'));//Line 186
        $font_variants = implode(',',$google_fonts_all[$font_index ['variants']); //Line 187
                array_push(
                    $import_fonts,array(
                        'font_family' => $collection['font_family'],'font_variant' => $font_variants,

解决方法

您会收到错误消息,因为在第186行中,$ google_fonts_all不包含带有'family'键的数组,或者它不是数组。无论哪种情况,表达式array_column($ google_fonts_all,'family')都返回空。

您可以将后面的表达式提取到变量中: $ family = array_column((array)$ google_fonts_all,'family');

在第187行上,在条件语句或行程中检查isset($ google_fonts_all [$ font_index] ['variants'])。

问候 埃里亚苏

,

智慧实验室已发布patch来解决此问题。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...