Changeset 20029 for trunk/wp-admin/includes/ms.php
- Timestamp:
- 02/28/2012 09:24:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r19712 r20029 170 170 } 171 171 172 function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {173 $themes = get_themes();174 175 if ( $blog_id != 0 )176 switch_to_blog( $blog_id );177 178 $blog_allowed_themes = get_option( 'allowedthemes' );179 if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes180 $blog_allowed_themes = get_option( 'allowed_themes' );181 182 if ( is_array( $blog_allowed_themes ) ) {183 foreach( (array) $themes as $key => $theme ) {184 $theme_key = esc_html( $theme['Stylesheet'] );185 if ( isset( $blog_allowed_themes[$key] ) == true ) {186 $blog_allowedthemes[$theme_key] = 1;187 }188 }189 $blog_allowed_themes = $blog_allowedthemes;190 add_option( 'allowedthemes', $blog_allowed_themes );191 delete_option( 'allowed_themes' );192 }193 }194 195 if ( $blog_id != 0 )196 restore_current_blog();197 198 return $blog_allowed_themes;199 }200 201 172 function update_option_new_admin_email( $old_value, $value ) { 202 173 $email = get_option( 'admin_email' ); … … 296 267 } 297 268 add_action( 'admin_notices', 'new_user_email_admin_notice' ); 298 299 function get_site_allowed_themes() {300 $themes = get_themes();301 $allowed_themes = get_site_option( 'allowedthemes' );302 if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {303 $allowed_themes = get_site_option( 'allowed_themes' ); // convert old allowed_themes format304 if ( !is_array( $allowed_themes ) ) {305 $allowed_themes = array();306 } else {307 foreach( (array) $themes as $key => $theme ) {308 $theme_key = esc_html( $theme['Stylesheet'] );309 if ( isset( $allowed_themes[ $key ] ) == true ) {310 $allowedthemes[ $theme_key ] = 1;311 }312 }313 $allowed_themes = $allowedthemes;314 }315 }316 return $allowed_themes;317 }318 269 319 270 /**
Note: See TracChangeset
for help on using the changeset viewer.