[wp-cvs] wordpress/wp-includes functions.php,1.199,1.200
Ryan Boren
rboren at users.sourceforge.net
Sun Oct 24 23:48:53 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31850/wp-includes
Modified Files:
functions.php
Log Message:
List broken themes and suggest corrective action.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** functions.php 20 Oct 2004 21:28:37 -0000 1.199
--- functions.php 24 Oct 2004 23:48:51 -0000 1.200
***************
*** 1994,1997 ****
--- 1994,1998 ----
function get_themes() {
global $wp_themes;
+ global $wp_broken_themes;
if (isset($wp_themes)) {
***************
*** 2000,2003 ****
--- 2001,2005 ----
$themes = array();
+ $wp_broken_themes = array();
$theme_loc = 'wp-content/themes';
$theme_root = ABSPATH . $theme_loc;
***************
*** 2008,2017 ****
--- 2010,2028 ----
while(($theme_dir = $themes_dir->read()) !== false) {
if (is_dir($theme_root . '/' . $theme_dir)) {
+ if ($theme_dir == '.' || $theme_dir == '..') {
+ continue;
+ }
$stylish_dir = @ dir($theme_root . '/' . $theme_dir);
+ $found_stylesheet = false;
while(($theme_file = $stylish_dir->read()) !== false) {
if ( $theme_file == 'style.css' ) {
$theme_files[] = $theme_dir . '/' . $theme_file;
+ $found_stylesheet = true;
+ break;
}
}
+ if (!$found_stylesheet) {
+ $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
+ }
}
}
***************
*** 2063,2066 ****
--- 2074,2082 ----
$stylesheet = dirname($theme_file);
+ if (empty($name)) {
+ $name = dirname($theme_file);
+ $title = $name;
+ }
+
if (empty($template)) {
if (file_exists(dirname("$theme_root/$theme_file/index.php"))) {
***************
*** 2074,2084 ****
if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
continue;
}
-
- if (empty($name)) {
- $name = dirname($theme_file);
- $title = $name;
- }
$stylesheet_files = array();
--- 2090,2096 ----
if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
+ $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
continue;
}
$stylesheet_files = array();
More information about the cvs
mailing list