【问题标题】:Wordpress Custom tables pluginWordpress 自定义表格插件
【发布时间】:2012-10-27 03:07:28
【问题描述】:

当我为 Wordpress 使用“custom tables”插件时,如何解决这个警告? 谁能帮帮我

警告:在第 378 行的 ..\wp-content\plugins\custom-tables\pages\show_table.php 中为 foreach() 提供的参数无效

此插件的网址 http://wordpress.org/extend/plugins/custom-tables/

【问题讨论】:

标签: php wordpress


【解决方案1】:

Invalid argument supplied for foreach() 是在foreach() 中传入的元素不是数组时获得的。对于这个插件,在第 378 行:

foreach ($qry as $row) {

你可以在通过foreach循环之前测试它是否是一个数组:

if ( is_array($qry ))
{
  foreach ($qry as $row) {...}
}
else die('not an array');

但是,我鼓励您从插件支持论坛提问。作者可以修复插件(假设是插件本身的问题)。不建议自己修改插件的核心,因此更新该插件会覆盖您的更改。

【讨论】:

    猜你喜欢
    • 2021-12-18
    • 1970-01-01
    • 2021-06-21
    • 2013-07-25
    • 1970-01-01
    • 2014-08-13
    • 2016-05-19
    • 2018-08-20
    • 1970-01-01
    相关资源
    最近更新 更多