【发布时间】:2012-09-25 21:15:27
【问题描述】:
function getWidgets($position = null) {
if (empty($this->widgets)) {
foreach (wp_get_sidebars_widgets() as $pos => $ids) {
$this->widgets[$pos] = array();
foreach ($ids as $id) { // error is here
$this->widgets[$pos][$id] = $this->getWidget($id);
}
}
}
}
这些是第 305-314 行。
我收到此错误:
" Warning: Invalid argument supplied for foreach() in /home/content/73/9889573/html/wp-content/themes/yoo_spark_wp/warp/systems/wordpress.3.0/helpers/system.php on line 310 "
谁能告诉我如何解决它
【问题讨论】:
-
您的行号有点偏离,因为第 310 行是
$this->widgets[$pos][$id] = $this->getWidget($id);,但错误是指 foreach 循环中的参数。