在您的wp-config.php
确保包括:;
define( \'WP_DEBUG\', true );
define( \'WP_DEBUG_DISPLAY\', true );
有时,您的环境在输出堆栈跟踪方面会做得更好。
如果这不起作用,您可以在WP core中执行该行并添加;
$backtrace = debug_backtrace();
print(\'<pre>\');
print_r ( $backtrace );
例如,这会给你提供更多的信息;
/*
Array
(
[0] => Array
(
[file] => /site/wp-content/plugins/debug-bar-console/class-debug-bar-console.php
[line] => 84
[function] => eval
)
[1] => Array
(
[function] => ajax
[class] => Debug_Bar_Console
[object] => Debug_Bar_Console Object
(
[_title] => Console
[_visible] => 1
)
[type] => ->
[args] => Array
(
[0] =>
)
)
[2] => Array
(
[file] => /site/wp-includes/plugin.php
[line] => 525
[function] => call_user_func_array
[args] => Array
(
[0] => Array
(
[0] => Debug_Bar_Console Object
(
[_title] => Console
[_visible] => 1
)
[1] => ajax
)
[1] => Array
(
[0] =>
)
)
)
[3] => Array
(
[file] => /site/wp-admin/admin-ajax.php
[line] => 89
[function] => do_action
[args] => Array
(
[0] => wp_ajax_debug_bar_console
)
)
)
*/