Skip to content

Instantly share code, notes, and snippets.

@Braunson
Created August 19, 2013 18:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Braunson/6272471 to your computer and use it in GitHub Desktop.
Save Braunson/6272471 to your computer and use it in GitHub Desktop.
Wordpress Theme Debugging Code - Helping to debug larger complex themes - http://www.braunson.ca/blog/posts/debugging-a-complex-wordpress-theme
<?php
$included_files = get_included_files();
$stylesheet_dir = str_replace( '\\', '/', get_stylesheet_directory() );
$template_dir = str_replace( '\\', '/', get_template_directory() );
foreach ( $included_files as $key => $path ) {
$path = str_replace( '\\', '/', $path );
if ( false === strpos( $path, $stylesheet_dir ) && false === strpos( $path, $template_dir ) )
unset( $included_files[$key] );
}
print_r( $included_files );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment