Skip to content

Instantly share code, notes, and snippets.

@brettshumaker
Created May 12, 2013 13:41
Show Gist options
  • Save brettshumaker/5563598 to your computer and use it in GitHub Desktop.
Save brettshumaker/5563598 to your computer and use it in GitHub Desktop.
Adds a Dashboard widget that displays all included theme files. Useful for tracking down bugs because you can see every file that's being loaded in the admin.
function add_show_inc_file_widget() {
wp_add_dashboard_widget('included-files', 'Show Included Theme Files', 'show_included_theme_files');
}
add_action('wp_dashboard_setup', 'add_show_inc_file_widget' );
function show_included_theme_files(){
$included_files = get_included_files();
foreach ($included_files as $filename) {
if (strpos($filename, "THEME-FOLDER-NAME")) echo $filename."<br />";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment