Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_debug_backtrace_summary [ WordPress Function ]

wp_debug_backtrace_summary ( $ignore_class = null, $skip_frames = 0, $pretty = true )
Parameters:
  • (string) $ignore_class A class to ignore all function calls within - useful when you want to just give info about the callee
  • (int) $skip_frames A number of stack frames to skip - useful for unwinding back to the source of the issue
  • (bool) $pretty Whether or not you want a comma separated string or raw array returned
Links:
Returns:
  • (string|array) Either a string containing a reversed comma separated trace or an array of individual calls.
Defined at:



Return a comma separated string of functions that have been called to get to the current point in code.

Source


<?php
function wp_debug_backtrace_summary$ignore_class null$skip_frames 0$pretty true ) {
    
$trace  debug_backtracefalse );
    
$caller = array();
    
$check_class = ! is_null$ignore_class );
    
$skip_frames++; // skip this function

    
foreach ( $trace as $call ) {
        if ( 
$skip_frames ) {
            
$skip_frames--;
        } elseif ( isset( 
$call['class'] ) ) {
            if ( 
$check_class && $ignore_class == $call['class'] )
                continue; 
// Filter out calls

            
$caller[] = "{$call['class']}{$call['type']}{$call['function']}";
        } else {
            if ( 
in_array$call['function'], array( 'do_action''apply_filters' ) ) ) {
                
$caller[] = "{$call['function']}('{$call['args'][0]}')";
            } elseif ( 
in_array$call['function'], array( 'include''include_once''require''require_once' ) ) ) {
                
$caller[] = $call['function'] . "('" str_replace( array( WP_CONTENT_DIRABSPATH ) , ''$call['args'][0] ) . "')";
            } else {
                
$caller[] = $call['function'];
            }
        }
    }
    if ( 
$pretty )
        return 
join', 'array_reverse$caller ) );
    else
        return 
$caller;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics