Title: wp_debug_backtrace_summary
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_debug_backtrace_summary( string $ignore_class = null, int $skip_frames, bool $pretty = true ): string|array

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#wp--skip-link--target)

Returns a comma-separated string or array of functions that have been called to 
get to the current point in code.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#see-also)󠁿

 * [https://core.trac.wordpress.org/ticket/19589](https://core.trac.wordpress.org/ticket/19589/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#parameters)󠁿

 `$ignore_class`stringoptional

A class to ignore all function calls within – useful when you want to just give 
info about the callee.

Default:`null`

`$skip_frames`intoptional

A number of stack frames to skip – useful for unwinding back to the source of the
issue. Default 0.

`$pretty`booloptional

Whether you want a comma separated string instead of the raw array returned.

Default:`true`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#return)󠁿

 string|array Either a string containing a reversed comma separated trace or an 
array of individual calls.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#source)󠁿

    ```php
    function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
    	static $truncate_paths;

    	$trace       = debug_backtrace( false );
    	$caller      = array();
    	$check_class = ! is_null( $ignore_class );
    	++$skip_frames; // Skip this function.

    	if ( ! isset( $truncate_paths ) ) {
    		$truncate_paths = array(
    			wp_normalize_path( WP_CONTENT_DIR ),
    			wp_normalize_path( ABSPATH ),
    		);
    	}

    	foreach ( $trace as $call ) {
    		if ( $skip_frames > 0 ) {
    			--$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', 'do_action_ref_array', 'apply_filters_ref_array' ), true ) ) {
    				$caller[] = "{$call['function']}('{$call['args'][0]}')";
    			} elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ), true ) ) {
    				$filename = isset( $call['args'][0] ) ? $call['args'][0] : '';
    				$caller[] = $call['function'] . "('" . str_replace( $truncate_paths, '', wp_normalize_path( $filename ) ) . "')";
    			} else {
    				$caller[] = $call['function'];
    			}
    		}
    	}
    	if ( $pretty ) {
    		return implode( ', ', array_reverse( $caller ) );
    	} else {
    		return $caller;
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/functions.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/functions.php#L7241)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/functions.php#L7241-L7281)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_normalize_path()](https://developer.wordpress.org/reference/functions/wp_normalize_path/)`wp-includes/functions.php` |

Normalizes a filesystem path.

  |

| Used by | Description | 
| [wpdb::get_caller()](https://developer.wordpress.org/reference/classes/wpdb/get_caller/)`wp-includes/class-wpdb.php` |

Retrieves a comma-separated list of the names of the functions that called [wpdb](https://developer.wordpress.org/reference/classes/wpdb/).

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/?output_format=md#comment-content-2551)
 2.   [Ulrich](https://profiles.wordpress.org/grapplerulrich/)  [  8 years ago  ](https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/#comment-2551)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_debug_backtrace_summary%2F%23comment-2551)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_debug_backtrace_summary%2F%23comment-2551)
 4.     ```php
        error_log( wp_debug_backtrace_summary() ); 
        ```
    
 5. [Source](https://westi.wordpress.com/2012/01/28/tracing-things-back-to-where-they-came-from/)
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_debug_backtrace_summary%2F%3Freplytocom%3D2551%23feedback-editor-2551)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_debug_backtrace_summary%2F)
before being able to contribute a note or feedback.