Skip to content

Instantly share code, notes, and snippets.

@mrtwebdesign
Created December 30, 2013 08:12
Show Gist options
  • Select an option

  • Save mrtwebdesign/8179235 to your computer and use it in GitHub Desktop.

Select an option

Save mrtwebdesign/8179235 to your computer and use it in GitHub Desktop.
function to display all of the files used in creating the page for WordPress theme
function filetracker(){
$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 = '<br>'.str_replace( '\\', '/', $path );
if ( false === strpos( $path, $stylesheet_dir ) && false === strpos( $path, $template_dir ) )
unset( $included_files[$key] );
}
echo '<pre>'; print_r($included_files); echo '</pre>';
return;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment