From a467a5c5984cc78cf369300153b751e4f0558f56 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 29 Mar 2007 09:59:41 +0000 Subject: Fix those pesky themes (fixes #284) git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@948 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/admin-db.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'wp-admin/admin-db.php') diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index 6800881..ef3d82f 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -659,4 +659,25 @@ function wpmu_get_blog_allowedthemes( $blog_id = 0 ) { return $blog_allowed_themes; } +function get_site_allowed_themes() { + $themes = get_themes(); + $allowed_themes = get_site_option( 'allowedthemes' ); + if( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) { + $allowed_themes = get_site_option( "allowed_themes" ); // convert old allowed_themes format + if( !is_array( $allowed_themes ) ) { + $allowed_themes = array(); + continue; + } + foreach( $themes as $key => $theme ) { + $theme_key = wp_specialchars( $theme[ 'Stylesheet' ] ); + if( isset( $allowed_themes[ $key ] ) == true ) { + $allowedthemes[ $theme_key ] = 1; + } + } + $allowed_themes = $allowedthemes; + } + + return $allowed_themes; +} + ?> -- cgit