Skip to content

Instantly share code, notes, and snippets.

@coquer
Created March 3, 2015 10:07
Show Gist options
  • Save coquer/a312421c6c551cd8a2f4 to your computer and use it in GitHub Desktop.
Save coquer/a312421c6c551cd8a2f4 to your computer and use it in GitHub Desktop.
Wordpress Finding Files inside A mess
$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] );
}
//var_dump( $included_files );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment