Created
May 12, 2013 13:41
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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