Reduce the size of the data returned by get_themes() by ~30% by reducing duplication.

git-svn-id: https://develop.svn.wordpress.org/trunk@12226 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2009-11-19 20:45:37 +00:00
parent 1ca762ff8d
commit fffae7eb1f
1 changed files with 4 additions and 1 deletions

View File

@ -365,6 +365,10 @@ function get_themes() {
@ $template_dir->close();
}
//Make unique and remove duplicates when stylesheet and template are the same i.e. most themes
$template_files = array_unique($template_files);
$stylesheet_files = array_unique($stylesheet_files);
$template_dir = dirname($template_files[0]);
$stylesheet_dir = dirname($stylesheet_files[0]);
@ -595,7 +599,6 @@ function search_theme_directories() {
if ( is_dir( $theme_dir ) )
@closedir( $theme_dir );
}
return $theme_files;
}