diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-03-29 09:59:41 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-03-29 09:59:41 +0000 |
commit | a467a5c5984cc78cf369300153b751e4f0558f56 (patch) | |
tree | 18f38e2cf940b89770adbf14c2daa3d3d83ca077 /wp-admin/admin-db.php | |
parent | 9761f43b0336e7b967d2d91d36b76a89a68b2901 (diff) | |
download | wordpress-mu-a467a5c5984cc78cf369300153b751e4f0558f56.tar.gz wordpress-mu-a467a5c5984cc78cf369300153b751e4f0558f56.tar.xz wordpress-mu-a467a5c5984cc78cf369300153b751e4f0558f56.zip |
Fix those pesky themes (fixes #284)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@948 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/admin-db.php')
-rw-r--r-- | wp-admin/admin-db.php | 21 |
1 files changed, 21 insertions, 0 deletions
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; +} + ?> |