gpt4 book ai didi

javascript - Content Aware Sidbars 插件博客页面上的错误通知

转载 作者:行者123 更新时间:2023-11-28 04:22:59 25 4
gpt4 key购买 nike

我正在使用 Genesis LifeStyle Pro 子主题。网址:https://www.test.rainerklar.de/blog-fuer-verjuengung-und-gesundheit/

在显示所有带有摘录的帖子的博客页面上,我在标题顶部看到错误通知:

Notice: Array to string conversion in /home/jungvita/public_html/test/wp-content/plugins/content-aware-sidebars/lib/wp-content-aware-engine/core.php on line 312

如果我在该页面上使用或不使用侧边栏插件,则此错误是可见的并且需要修复。该页面应该有标准的主侧边栏。我尝试在没有此页面插件的情况下工作,并通过为页面类型设置“posts”来使用该插件,而不需要任何其他定义。

这是第312行和313行的代码:

$data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".implode("','",$data) ."'))";
}

编辑:使用调试插件我收到此通知:

NOTICE: wp-content/plugins/content-aware-sidebars/lib/wp-content-aware-    engine/core.php:312 - Array to string conversion
require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/lifestyle-pro/home.php'), genesis, get_header, locate_template, load_template, require_once('/themes/lifestyle-pro/header.php'), do_action('genesis_meta'), WP_Hook->do_action,WP_Hook->apply_filters, blog_page_genesis_meta, is_active_sidebar, wp_get_sidebars_widgets, apply_filters('sidebars_widgets'), WP_Hook->apply_filters, CAS_Sidebar_Manager->replace_sidebar, WPCACore::get_posts, WPCACore::get_conditions, implode

也许有帮助?!

EDIT2:这是该部分的完整代码

//如果存在则返回缓存

“core.php”(插件):

// Return cache if present
if(isset(self::$condition_cache[$post_type])) {
return self::$condition_cache[$post_type];
}

$excluded = array();
$where = array();
$join = array();

$cache = array(
$post_type
);

$modules = self::$type_manager->get($post_type)->get_all();

foreach (self::$type_manager->get_all() as $key => $type) {
if($key == $post_type) {
continue;
}
if($type->get_all() === $modules) {
$cache[] = $key;
}
}

foreach ($modules as $module) {
$id = $module->get_id();
if(apply_filters("wpca/module/{$id}/in-context", $module->in_context())) {
$join[$id] = apply_filters("wpca/module/{$id}/db-join", $module->db_join());
$data = $module->get_context_data();
if(is_array($data)) {
$data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".implode("','",$data) ."'))";
}
$where[$id] = apply_filters("wpca/module/{$id}/db-where", $data);
} else {
$excluded[] = $module;
}
}

没有行号,所以寻找

if(is_array($data)) {
$data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".implode("','",$data) ."'))";
}

这些行是 311 到 313。

最佳答案

this thread我找到了解决方案:

Mit einem @ kannst du normalerweise die Fehlermeldungen ausschalten

我这样做是把 @ 放在“内爆”之前:

$data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".@implode("','",$data) ."'))"; } Now the notice is gone.

关于javascript - Content Aware Sidbars 插件博客页面上的错误通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45299990/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com