Changeset 12755 for trunk/wp-admin/includes/theme.php
- Timestamp:
- 01/18/2010 11:34:36 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/theme.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/theme.php
r12752 r12755 118 118 119 119 /** 120 * Get the allowed themes for the current blog. 121 * 122 * @since 3.0 123 * 124 * @uses get_themes() 125 * @uses current_theme_info() 126 * @uses get_site_allowed_themes() 127 * @uses wpmu_get_blog_allowedthemes 128 * 129 * @return array $themes Array of allowed themes. 130 */ 131 function get_allowed_themes() { 132 if ( !is_multisite() ) 133 return get_themes(); 134 135 $themes = get_themes(); 136 $ct = current_theme_info(); 137 $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); 138 if ( $allowed_themes == false ) 139 $allowed_themes = array(); 140 141 $blog_allowed_themes = wpmu_get_blog_allowedthemes(); 142 if ( is_array( $blog_allowed_themes ) ) 143 $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes ); 144 145 if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false ) 146 $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true; 147 148 reset( $themes ); 149 foreach ( $themes as $key => $theme ) { 150 if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) 151 unset( $themes[ $key ] ); 152 } 153 reset( $themes ); 154 155 return $themes; 156 } 157 158 /** 120 159 * Get the Page Templates available in this theme 121 160 *
Note: See TracChangeset
for help on using the changeset viewer.