我在我的WordPress网站上,这些重复消息在我的仪表板上弹出。我正在使用WordPress 4.7.1。我没有在我的网站上的FeedWordPress插件,因为我看到他们也有这个错误的问题。警告:call_user_func_array()期望参数1是一个有效的回调,没有数组或字符串
警告:call_user_func_array()预计参数1是一个有效的 回调,没有在 /home/mydomain/public_html/wp-includes/class-wp-hook.php给定线298
数组或字符串警告:call_user_func_array()预计参数1是一个有效的 回调,没有在 /home/mydomain/public_html/wp-includes/class-wp-hook.php给定线阵列或串298
此线是298
$value = call_user_func_array($the_['function'], $args);
这是包含线298
public function apply_filters($value, $args) {
if (! $this->callbacks) {
return $value;
}
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys($this->callbacks);
$num_args = count($args);
do {
$this->current_priority[ $nesting_level ] = $priority = current($this->iterations[ $nesting_level ]);
foreach ($this->callbacks[ $priority ] as $the_) {
if(! $this->doing_action) {
$args[ 0 ] = $value;
}
// Avoid the array_slice if possible.
if ($the_['accepted_args'] == 0) {
$value = call_user_func_array($the_['function'], array());
} elseif ($the_['accepted_args'] >= $num_args) {
$value = call_user_func_array($the_['function'], $args);
} else {
$value = call_user_func_array($the_['function'], array_slice($args, 0, (int)$the_['accepted_args']));
}
}
} while (false !== next($this->iterations[ $nesting_level ]));
unset($this->iterations[ $nesting_level ]);
unset($this->current_priority[ $nesting_level ]);
$this->nesting_level--;
return $value;
}
这是一个严重的警告功能?如果是这样,我该如何解决这个问题?
https://wordpress.org/support/topic/call_user_func_array-expects-parameter-1-to-be-valid-custom-function/和[跨站点重复数据删除](HTTP:// wordpress的。 stackexchange.com/questions/108860/error-call-user-func-array-expects-parameter-1-to-be-a-valid-callback) – Machavity
我敢打赌问题是'add_filter'和任何地方你告诉WP称这个 – Machavity
不幸的是,这个错误是误导。问题可能发生在列出的线路上,但是在其他地方触发 –