Wordpres调试.log PHP注意:已调用IS_SINGLIC

时间:2020-05-31 作者:Gabriel

在我的调试中,我已经开始调用很多“is\\u singular was called”和“is\\u page was called”。日志

[31-May-2020 12:10:27 UTC] PHP Notice:  is_page was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wp-includes/functions.php on line 5167
[31-May-2020 12:10:27 UTC] PHP Notice:  is_singular was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wp-includes/functions.php on line 5167
在功能中的第5167行。php有以下代码

        sprintf(
            /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: Version information message. */
            __( \'%1$s was called <strong>incorrectly</strong>. %2$s %3$s\' ),
            $function,
            $message,
            $version
        ),
        E_USER_NOTICE
    );
谁能帮我找到解决问题的正确方向?

非常感谢你regardsGabriel

1 个回复
SO网友:Matthew Brown aka Lord Matt

如果我冒昧猜测一下,我会说你最近开始使用一个主题或插件,或者其中一个是最近更新的。错误表明事情发生的顺序不对。这并不重要,但在某些地方,某些预期的功能可能没有按照预期的方式实现。

您的第一步是确定哪些是新的(已安装或更新的),尝试一次切换一个,看看哪个错误在不使用时停止。那是你的罪魁祸首。

相关推荐

500 Internal Errors

我正在将当前的Eduma主题更新为最新版本(3.0.9.1),目前的版本是3.0.7。我正在运行WordPress 4.7.5。但是,在运行更新时,我得到Update Failed: Internal Server Error 安装过程中的消息。所以我启动了这个过程,它运行了一分钟,然后它就停止了工作,我陷入了维护模式。所以我必须手动删除.maintenance 来自我的服务器的文件。我截图了我在错误中看到的内容。我在WordPress网站上运行了调试模式,这就是我所拥有的[31-May-2017 15: