admin管理员组文章数量:1130349
I've read the other posts about this issue, but mine is different in one fundamental way... there is no function defined in the error. It reads like this:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in /home/ovbar/public_html/wp-includes/plugin.php on line 496
I've never seen this error without a function defined so I'm at a loss. I moved it using the All-in-One WP Migration plugin. Any ideas? Here's what I've done so far:
- I've already checked for hard-coded urls just to be sure, and there aren't any.
- Deactivating all plugins still shows this error.
Every other aspect of the site works fine. This error only displays on the front end.
Any ideas?
I've read the other posts about this issue, but mine is different in one fundamental way... there is no function defined in the error. It reads like this:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in /home/ovbar/public_html/wp-includes/plugin.php on line 496
I've never seen this error without a function defined so I'm at a loss. I moved it using the All-in-One WP Migration plugin. Any ideas? Here's what I've done so far:
- I've already checked for hard-coded urls just to be sure, and there aren't any.
- Deactivating all plugins still shows this error.
Every other aspect of the site works fine. This error only displays on the front end.
Any ideas?
Share Improve this question edited Jan 24, 2015 at 8:27 Pieter Goosen 55.5k23 gold badges117 silver badges211 bronze badges asked Jan 24, 2015 at 8:16 KingRichardKingRichard 1771 silver badge11 bronze badges 4 |1 Answer
Reset to default 1I've successfully tracked this problem by adding
error_log("wp-hook: ". print_r($the_, true));
within apply_filters in wp-includes/wp_hook.php
The task is then to look at the function calls (the data inside $the_) surrounding the "PHP Warning: call_user_func_array()". It will be the one directly ahead of the warning, but you may need to look at calls after or before to determine which file is causing the problem (a filter call to an undefined function).
Note also that the problem will arise if the function exists, but has no code, like:
function create_menu() {
//oops, there's no code here
}
add_action('admin_menu',array($this,'create_menu'));
I've read the other posts about this issue, but mine is different in one fundamental way... there is no function defined in the error. It reads like this:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in /home/ovbar/public_html/wp-includes/plugin.php on line 496
I've never seen this error without a function defined so I'm at a loss. I moved it using the All-in-One WP Migration plugin. Any ideas? Here's what I've done so far:
- I've already checked for hard-coded urls just to be sure, and there aren't any.
- Deactivating all plugins still shows this error.
Every other aspect of the site works fine. This error only displays on the front end.
Any ideas?
I've read the other posts about this issue, but mine is different in one fundamental way... there is no function defined in the error. It reads like this:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '' not found or invalid function name in /home/ovbar/public_html/wp-includes/plugin.php on line 496
I've never seen this error without a function defined so I'm at a loss. I moved it using the All-in-One WP Migration plugin. Any ideas? Here's what I've done so far:
- I've already checked for hard-coded urls just to be sure, and there aren't any.
- Deactivating all plugins still shows this error.
Every other aspect of the site works fine. This error only displays on the front end.
Any ideas?
Share Improve this question edited Jan 24, 2015 at 8:27 Pieter Goosen 55.5k23 gold badges117 silver badges211 bronze badges asked Jan 24, 2015 at 8:16 KingRichardKingRichard 1771 silver badge11 bronze badges 4-
1
You could try temporarily adding debugging stuff to the core, eg at
add_actionin "wp-includes/plugin.php" line 431 puttingif ( empty( $function_to_add ) ) echo '<pre>', debug_print_backtrace(), '</pre>';. – bonger Commented Jan 24, 2015 at 11:53 - I tried that, to no avail. I also tried using a try catch around the failing statement on line 496 but I get the same error. – KingRichard Commented Jan 24, 2015 at 17:46
- 1 The try/catch should do it though if you turn it into an exception - see stackoverflow/questions/1241728/can-i-try-catch-a-warning – bonger Commented Jan 24, 2015 at 18:06
-
I ended up just adding
error_reporting(0);to the bottom of my wp-config file. It's only for that theme, and I'm going to be reworking it anyway. I went through the theme (poorly built) and commented out all of theadd_action()s and the error still displayed, but if I switch themes it's gone. So for now, turning off warnings will do. – KingRichard Commented Jan 25, 2015 at 1:38
1 Answer
Reset to default 1I've successfully tracked this problem by adding
error_log("wp-hook: ". print_r($the_, true));
within apply_filters in wp-includes/wp_hook.php
The task is then to look at the function calls (the data inside $the_) surrounding the "PHP Warning: call_user_func_array()". It will be the one directly ahead of the warning, but you may need to look at calls after or before to determine which file is causing the problem (a filter call to an undefined function).
Note also that the problem will arise if the function exists, but has no code, like:
function create_menu() {
//oops, there's no code here
}
add_action('admin_menu',array($this,'create_menu'));
本文标签: migrationcalluserfuncarray() error on front end
版权声明:本文标题:migration - call_user_func_array() error on front end 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749059624a2309899.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


add_actionin "wp-includes/plugin.php" line 431 puttingif ( empty( $function_to_add ) ) echo '<pre>', debug_print_backtrace(), '</pre>';. – bonger Commented Jan 24, 2015 at 11:53error_reporting(0);to the bottom of my wp-config file. It's only for that theme, and I'm going to be reworking it anyway. I went through the theme (poorly built) and commented out all of theadd_action()s and the error still displayed, but if I switch themes it's gone. So for now, turning off warnings will do. – KingRichard Commented Jan 25, 2015 at 1:38