我使用的是创世纪LifeStyle专业儿童主题。网址:https://www.test.rainerklar.de/blog-fuer-verjuengung-und-gesundheit/
在我的博客页面上,显示了所有文章的节选,我在标题顶部看到一个错误通知:
注意:在第312行的/home/jungvita/public_html/test/wp-content/plugins/content-aware-sidebars/lib/wp-content-aware-engine/core.php中数组到字符串的转换
如果我使用侧栏插件或不使用此页面,此错误是可见的,需要修复。页面应该有标准的主侧边栏。我试图不使用此页面的插件,并通过为页面类型设置“post”来使用插件,而没有任何其他定义。
这是第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。
发布于 2017-07-26 22:40:08
在这条线中,我找到了一个解决方案:
Mit einem @ kannst du normalerweise die Fehlermeldungen ausschalten
我在“内爆”之前加上了@:
$data = "({$id}.meta_value为NULL或{$id}.meta_value IN“)(‘.@implode(’‘,’‘,$data) )”;}现在通知已消失。
https://stackoverflow.com/questions/45299990
复制相似问题