Changeset 20148 for trunk/wp-includes/class-wp-theme.php
- Timestamp:
- 03/08/2012 03:22:39 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class-wp-theme.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-theme.php
r20146 r20148 1085 1085 public static function get_allowed_on_network() { 1086 1086 static $allowed_themes; 1087 if ( isset( $allowed_themes ) ) 1088 return $allowed_themes; 1089 1090 $allowed_themes = get_site_option( 'allowedthemes' ); 1091 1092 // This is all super old MU back compat joy. 1093 // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name. 1094 if ( false === $allowed_themes ) { 1095 $allowed_themes = get_site_option( 'allowed_themes' ); 1096 if ( ! is_array( $allowed_themes ) || empty( $allowed_themes ) ) { 1097 $allowed_themes = array(); 1098 } else { 1099 $converted = array(); 1100 $themes = wp_get_themes(); 1101 foreach ( $themes as $stylesheet => $theme_data ) { 1102 if ( isset( $allowed_themes[ $theme_data->get('Name') ] ) ) 1103 $converted[ $stylesheet ] = true; 1104 } 1105 $allowed_themes = $converted; 1106 } 1107 // Set the option so we never have to go through this pain again. 1108 if ( ( is_admin() && is_main_site() ) || is_network_admin() ) { 1109 update_site_option( 'allowedthemes', $allowed_themes ); 1110 delete_site_option( 'allowed_themes' ); 1111 } 1112 } 1113 1087 if ( ! isset( $allowed_themes ) ) 1088 $allowed_themes = (array) get_site_option( 'allowedthemes' ); 1114 1089 return $allowed_themes; 1115 1090 } … … 1160 1135 } 1161 1136 // Set the option so we never have to go through this pain again. 1162 if ( is_admin() ) {1137 if ( is_admin() && $allowed_themes[ $blog_id ] ) { 1163 1138 if ( $current ) { 1164 1139 update_option( 'allowedthemes', $allowed_themes[ $blog_id ] );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)