首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误-来自内容感知Sidbar插件的博客页面

错误-来自内容感知Sidbar插件的博客页面
EN

Stack Overflow用户
提问于 2017-07-25 10:02:06
回答 1查看 41关注 0票数 1

我使用的是创世纪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行的代码:

代码语言:javascript
复制
$data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".implode("','",$data) ."'))";
                                                          }

编辑:通过一个调试插件,我得到了这样的通知:

代码语言:javascript
复制
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“(插件):

代码语言:javascript
复制
// 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;
            }
        }

没有行号,所以去找

代码语言:javascript
复制
if(is_array($data)) {
                    $data = "({$id}.meta_value IS NULL OR {$id}.meta_value IN ('".implode("','",$data) ."'))";
                }

这些线路是311至313。

EN

回答 1

Stack Overflow用户

发布于 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) )”;}现在通知已消失。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45299990

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档