Php 警告:call\u user\u func\u array()要求参数1是有效的回调,不提供数组或字符串
我在我的WordPress网站上,这些重复的消息会在我的仪表板上弹出。我正在使用WordPress 4.7.1。我的网站上没有FeedWordPress插件,因为我看到他们也有这个错误的问题 警告:call\u user\u func\u array()要求参数1是有效的 回调,中未给出数组或字符串 /第298行的home/mydomain/public_html/wp includes/class-wp-hook.php 警告:call\u user\u func\u array()要求参数1是有效的 回调,中未给出数组或字符串 /第298行的home/mydomain/public_html/wp includes/class-wp-hook.php 这条线是298Php 警告:call\u user\u func\u array()要求参数1是有效的回调,不提供数组或字符串,php,wordpress,Php,Wordpress,我在我的WordPress网站上,这些重复的消息会在我的仪表板上弹出。我正在使用WordPress 4.7.1。我的网站上没有FeedWordPress插件,因为我看到他们也有这个错误的问题 警告:call\u user\u func\u array()要求参数1是有效的 回调,中未给出数组或字符串 /第298行的home/mydomain/public_html/wp includes/class-wp-hook.php 警告:call\u user\u func\u array()要求参数1
$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;
}
这是严重警告吗?如果是这样,我将如何解决这个问题?只是为了更新这个线程-升级到4.7.2时我遇到了相同的错误。我一个接一个地停用了我的插件,发现一个插件导致了问题只是为了更新这个线程-升级到4.7.2时我遇到了相同的错误。我一个接一个地停用了我的插件,发现一个插件导致了问题你说你停用了一些插件,并修复了它。是什么插件导致了这个问题,因为我得到的是相同的东西你说你停用了一些插件,并修复了它。是什么插件导致了这个问题,因为我得到了同样的东西我也有同样的问题。我禁用了Slider Revolution插件,它解决了这个问题
希望对你有帮助 我也有同样的问题。我禁用了Slider Revolution插件,它解决了这个问题
I am not getting the exact solution, but I got a temporary solution for immediate basis,
just hide it, I use the function on the top of the file after
'<?php' start. It disables the warning.
define('WP_DEBUG_DISPLAY', false); //It's work for me
You may also try
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
希望对你有帮助 我没有得到确切的解决方案,但我得到了一个临时的解决方案,
I am not getting the exact solution, but I got a temporary solution for immediate basis,
just hide it, I use the function on the top of the file after
'<?php' start. It disables the warning.
define('WP_DEBUG_DISPLAY', false); //It's work for me
You may also try
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
只需隐藏它,我使用文件顶部的函数
“我没有得到精确的解,但我得到了一个临时解作为即时基础,
只需隐藏它,我使用文件顶部的函数
“在wordpress操作挂钩的回调参数中添加函数而不是字符串时,会出现此警告。
例如:
这将导致警告:
add_action("wp_enqueue_scripts",somefunction());
但这不会:
add_action("wp_enqueue_scripts","somefunction");
或者,
如果未包含包含“somefunction”的文件,也会出现此警告
这些都是我复制的警告。在wordpress操作挂钩的回调参数中添加函数而不是字符串时,会出现此警告。
例如:
这将导致警告:
add_action("wp_enqueue_scripts",somefunction());
但这不会:
add_action("wp_enqueue_scripts","somefunction");
或者,
如果未包含包含“somefunction”的文件,也会出现此警告
这些都是我重复发出警告的情况。我敢打赌问题出在add\u filter
上,不管你让WP打电话给哪里,不幸的是错误是误导性的。问题可能发生在列出的行上,但它在其他地方触发,我敢打赌问题出在add\u filter
上,无论您在哪里告诉WP调用它,不幸的是,错误是误导性的。问题可能发生在列出的行上,但已触发其他行。请发布插件名称以帮助其他用户。请发布插件名称以帮助其他用户。