mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Refactor WPDB::get_caller() into wp_debug_backtrace_summary() and improve the functionality to provide enhanced context and a standardised default pretty format. Fixes #19589
git-svn-id: https://develop.svn.wordpress.org/trunk@19773 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+1
-10
@@ -1545,16 +1545,7 @@ class wpdb {
|
||||
* @return string The name of the calling function
|
||||
*/
|
||||
function get_caller() {
|
||||
$trace = array_reverse( debug_backtrace() );
|
||||
$caller = array();
|
||||
|
||||
foreach ( $trace as $call ) {
|
||||
if ( isset( $call['class'] ) && __CLASS__ == $call['class'] )
|
||||
continue; // Filter out wpdb calls.
|
||||
$caller[] = isset( $call['class'] ) ? "{$call['class']}->{$call['function']}" : $call['function'];
|
||||
}
|
||||
|
||||
return join( ', ', $caller );
|
||||
return wp_debug_backtrace_summary( __CLASS__ );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user