diff options
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; +} + ?> |
